lorien/grab

Sending empty header filed

felyxjet opened this issue · 5 comments

Sometimes there is a real need to send header filed with empty value. Example here explains how to do that.

I was not aware that passing empty string as header value forces header to be removed from request. That does not look correct. I mean that current Grab behavior does not look correct. So that is really have to be done is to change Grab so it does not delete header if its value is empty string.
I do not think that any user of Grab uses empty string to remove headers from request.

Also, same behavior should be implemented for urllib3 transport (or should be done nothing if it is already work in correct way in urllib3).

I bet i saw this in the official documentation when i just started using grab long ago. And i was pretty sure that everyone else who uses grab makes use of that as a regular way to unset particular header(s).

At least author of Grab does not use empty headers in this way and even does not know that it works like this. So, nope, not everyone.

According to this https://tools.ietf.org/html/rfc7230#section-3.2 empty value is allowed

field-value = *( field-content / obs-fold )

I am closing this issue, because there is no pycurl backend in Grab anymore. And I guess no more users :D