[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [libmicrohttpd] Chunked encoding POST getting a 411 error
From: |
Christian Grothoff |
Subject: |
Re: [libmicrohttpd] Chunked encoding POST getting a 411 error |
Date: |
Thu, 24 Jan 2019 20:05:23 +0100 |
User-agent: |
Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.4.0 |
This most certainly is something that should be fixed in libmicrohttpd
and not in systemd. In fact, likely it cannot be fixed in systemd if I
am not mistaken.
If you are able to work on C code, the answer probably is to go into the
MHD code where we test for content-length on upload, also add a check
for 'chunked' encodings and then modify the logic to decode the chunked
upload.
On 1/24/19 7:28 PM, Kim Scarborough wrote:
> It's actually systemd doing this. It uses libmicrohttpd to listen for
> incoming journal messages. I'm not sure why it doesn't send sizes in the
> header for outgoing messages.
>
> I mainly just want to get systemd journal forwarding working. Would it
> be more to the point to open a bug with the systemd people? I'm just
> afraid they'll say "well, we're not violating the spec," and ignore it.
> Is there any way this could be changed on the libmicrohttpd end?
>
> On 1/23/19 10:22 PM, Christian Grothoff wrote:
>> You're not incorrect, but likely the first one to try this. I don't
>> recall anyone ever implementing this feature for uploads. Is there a
>> good reason why you need it? Usually clients telling the server up-front
>> how big the upload is, is a good idea, so that the server can reject
>> uploads that are too large for some reason. I've not yet seen an
>> application where the client doesn't know the size of the upload (not
>> saying there isn't one).
>>
>> On 1/24/19 3:14 AM, Kim Scarborough wrote:
>>> I'm using libmicrohttpd-0.9.62, and I'm having a problem with posting
>>> chunked-encoded files without a Content-Length header:
>>>
>>> POST /upload HTTP/1.1
>>> Host: myhost.example
>>> Transfer-Encoding: chunked
>>> Content-Type: application/vnd.fdo.journal
>>>
>>> HTTP/1.1 411 Length Required
>>> Connection: close
>>> Content-Length: 35
>>> Content-Type: text/plain
>>> Date: Thu, 24 Jan 2019 01:21:41 GMT
>>>
>>> I thought using "Transfer-Encoding: chunked" meant I didn't have to
>>> specify "Content-Length". Am I incorrect?
>>>
>>
>
signature.asc
Description: OpenPGP digital signature