On Sun, Nov 01, 2009 at 12:53:06PM +0100, Colin Fleming wrote:
> Using netcat and stunnel to see what's going on, it's very strange, I can
> make the exact same request with http-client and curl, curl works but
> http-client returns a 403:
> User-Agent: curl/7.19.6 (i386-apple-darwin10.0.0) libcurl/7.19.6
> OpenSSL/0.9.8k zlib/1.2.3
> Host: localhost:8889
> Accept: */*
> The first works, the second gives me a BadAuthentication error. That's
> http-client pretending to be curl. My call looks like the following:
> The request is to localhost:8889 for the netcat/stunnel proxy. Any ideas whyPossibly your request to google results in a 302 or 301 redirect with a
> this might fail?
cookie header, which causes a second request to be sent. I've
recently discovered that a *lot* of popular internet software doesn't
treat cookie names in a case-insensitive fashion (which it should,
according to the relevant RFCs), and intarweb does case normalization
on cookies, causing trouble with some software.
So maybe the original request is okay, but the other one is causing the
problems because the cookie isn't sent with exactly the same name.
I don't know the google API, so I'm just guessing here. Try tcpdump to
check out the entire HTTP conversation.
"The process of preparing programs for a digital computer
is especially attractive, not only because it can be economically
and scientifically rewarding, but also because it can be an aesthetic
experience much like composing poetry or music."
-- Donald Knuth