android_touch icon indicating copy to clipboard operation
android_touch copied to clipboard

Request Header content-length in lower first case makes server ignore requests!

Open GitMAGI opened this issue 6 years ago • 0 comments

The Content-Length Header in Requests must be UpperFirst-ed. content-length will make the server parse an empty request body. Content-Length in upper first, will work correctly. The problem is that if you are using tools like Postman, the header regarding the length of the body, is automatically written by the tool (in my case Postman writes it in lower case). I fixed it editing my local file httplib.h at line 511, in this way

auto len = get_header_value_int(x.headers, "Content-Length", 0);
if(!len)
    len = get_header_value_int(x.headers, "content-length", 0);

GitMAGI avatar Aug 20 '19 11:08 GitMAGI