libmicrohttpd
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libmicrohttpd] MHDs handling of HEADs and Content-Length


From: Damon Earp
Subject: [libmicrohttpd] MHDs handling of HEADs and Content-Length
Date: Tue, 23 Apr 2019 10:54:55 -0500

I started playing with newer versions of libmicrohttpd recently noticed an issue with HEAD requests after bumping up the library version from 0.9.51 to 0.9.63.

Platform: Debian 9.8 amd64 
$ uname -a 
Linux somehostname 4.9.0-8-amd64 #1 SMP Debian 4.9.130-2 (2018-10-27) x86_64 GNU/Linux
$ sudo apt show libmicrohttpd12
Package: libmicrohttpd12
Version: 0.9.51-1

For both HEAD and GET requests I have been creating my response with MHD_create_response_from_fd_at_offset64 and regardless of the method type the Content-Length header was always set correctly. In other words, I depend on libmicrohttpd to set the Content-Length header correctly for both types of requests and never explicitly set it.

Seeing as 0.9.51 is 2.5 years old I decided to try 0.9.63, I custom built a shared library w/ a deb package for it
...
$ ./configure --with-pic --prefix=/usr --libdir=/usr/lib/x86_64-linux-gnu --enable-https --disable-curl --disable-doc --disable-examples --enable-static=no

After installing the new version of the library my HEAD requests started responding with "Content-Length: 0", and GETs continued to have the correct value. Other than that everything else is working without a hitch.

If this is a bug, let me know if you need more information. Or if this is my misunderstanding of the statement "The library does understand HEAD and will only send the headers of the response and not the body, even if the client supplied a body." please let me know.

Thanks for this great library!
Damon

reply via email to

[Prev in Thread] Current Thread [Next in Thread]