Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

http.TestClient cannot parse OpenDNS http responses #544

Closed
gopherbot opened this issue Jan 19, 2010 · 4 comments
Closed

http.TestClient cannot parse OpenDNS http responses #544

gopherbot opened this issue Jan 19, 2010 · 4 comments

Comments

@gopherbot
Copy link

by MauriceGilden:

Before filing a bug, please check whether it has been fixed since
the latest release: run "hg pull -u" and retry what you did to
reproduce the problem.  Thanks.

What steps will reproduce the problem?
1. GOMAXPROCS=1 make all

What is the expected output? What do you see instead?
/home/shadowice/local/bin/gopack grc _test/http.a _gotest_.8 
make[3]: Leaving directory `/home/shadowice/local/go/src/pkg/http'
--- FAIL: http.TestClient
    parsing User-agent: *: invalid argument
FAIL
make[2]: *** [test] Error 1
make[2]: Leaving directory `/home/shadowice/local/go/src/pkg/http'
make[1]: *** [http.test] Error 2
make[1]: Leaving directory `/home/shadowice/local/go/src/pkg'
make: *** [run] Error 2

What is your $GOOS?  $GOARCH?
linux / 386

Which revision are you using?  (hg identify)
c3169cad2f47 tip

Please provide any additional information below.
@rsc
Copy link
Contributor

rsc commented Jan 19, 2010

Comment 1:

It looks like it's trying to parse the http body (the robots.txt) as if it were a
number, 
which suggests that the http header reading code is broken.  But it's working here.
Is it reproducible on your system?

Owner changed to r...@golang.org.

@gopherbot
Copy link
Author

Comment 2 by MauriceGilden:

It's reproducible. I also checked it on another system and everything works fine 
there (both with 41d37c2440fb tip right now). I also compared the response headers 
on both systems for http://www.google.com/robots.txt, they are different. And after 
some more investigation I can now reproduce the error on my other machine by 
changing the DNS server.
The working DNS server is the one from my ISP (T-Online). Not working is 
208.67.222.222 from OpenDNS. I've copied the non-working header below:
HTTP/1.0 200 OK
Content-Type: text/plain
Last-Modified: Tue, 15 Dec 2009 22:15:29 GMT
Set-Cookie: PREF=ID=14d10338add15be8:TM=1263926773:LM=1263926773:S=opq1ThF-KAf2KMDP; 
expires=Thu, 1$
Date: Tue, 19 Jan 2010 18:46:13 GMT
Server: gws
Cache-Control: private, x-gzip-ok=""
X-XSS-Protection: 0
Expires: Tue, 19 Jan 2010 18:46:13 GMT
X-Cache: MISS from .
Via: 1.0 .:80 (squid)
Connection: close
And this is what it probably should look like (and what works):
HTTP/1.0 200 OK
Content-Type: text/plain
Last-Modified: Tue, 15 Dec 2009 22:15:29 GMT
Set-Cookie: PREF=ID=9af674a66d32eab7:TM=1263926792:LM=1263926792:S=WtiYMKLI7a7XELq5; 
expires=Thu, 1$
Date: Tue, 19 Jan 2010 18:46:32 GMT
Server: gws
Cache-Control: private, x-gzip-ok=""
X-XSS-Protection: 0
Expires: Tue, 19 Jan 2010 18:46:32 GMT

@rsc
Copy link
Contributor

rsc commented Jan 19, 2010

Comment 3:

I have reproduced the problem by breaking net's dns implementation to always return the
IP address of the server 
that OpenDNS pretends is www.google.com.
Even though OpenDNS is lying to your computer and directing you to the wrong server, Go
should still be able to 
handle the reply.  Thanks for reporting this.
By the way, if you're avoiding your ISP's DNS server because it is too slow, might I
suggest 8.8.8.8 and 8.8.4.4?  ;-)
http://code.google.com/speed/public-dns/docs/intro.html

Status changed to Accepted.

@rsc
Copy link
Contributor

rsc commented Jan 20, 2010

Comment 5:

This issue was closed by revision 75c6dc9.

Status changed to Fixed.

Merged into issue #-.

@golang golang locked and limited conversation to collaborators Jun 24, 2016
@rsc rsc removed their assignment Jun 22, 2022
This issue was closed.
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants