[erlang-questions] Parsing custom HTTP headers with inet, [{active, false},{packet, http_bin}, ...]

zabrane Mikael zabrane3@REDACTED
Sun Aug 29 02:02:59 CEST 2010


Hi Tony,

>> $ curl -v -D - -x localhost:9876 -H 'X-ARCHWEB-RESOURCE-UUID:
>> 123456789' --url http://www.foo.com
>> * About to connect() to proxy 127.0.0.1 port 8080 (#0)
>> *   Trying 127.0.0.1...   % Total    % Received % Xferd  Average Speed
>
> Hmm why is it saying 8080 ? you wrote 9876?

Correct. It was a typo ;-)

> curl -v -D - -x localhost:8888 -H 'X-ARCHWEB-RESOURCE-UUID:123456789' --url http://www.foo.com
>
> * About to connect() to proxy localhost port 8888 (#0)
> *   Trying ::1... Connection refused
> *   Trying fe80::1... Connection refused
> *   Trying 127.0.0.1... connected
> * Connected to localhost (127.0.0.1) port 8888 (#0)
>> GET http://www.foo.com HTTP/1.1
>> User-Agent: curl/7.19.7 (universal-apple-darwin10.0) libcurl/7.19.7 OpenSSL/0.9.8l zlib/1.2.3
>> Host: www.foo.com
>> Accept: */*
>> Proxy-Connection: Keep-Alive
>> X-ARCHWEB-RESOURCE-UUID:123456789
>>
>
> The small test program I used worked fine:

Could you share it please?

> BTW The reason you get mixed cases on some (size <= 20) header names is because the packet parser
> normalize the input to the "normal" case usage (as in Content-Length). The header names
> are case insensitive anyway, so you must handle it.

Is there a way to tell the packet parser to not normalize anything?

-- 
Regards
Zabrane


More information about the erlang-questions mailing list