Re: Limitation in CFNetwork (uses HTTP/1.0 instead of HTTP/1.1)
Re: Limitation in CFNetwork (uses HTTP/1.0 instead of HTTP/1.1)
- Subject: Re: Limitation in CFNetwork (uses HTTP/1.0 instead of HTTP/1.1)
- From: Bryan Blackburn <email@hidden>
- Date: Sat, 24 May 2003 01:34:25 -0600
- Mail-followup-to: email@hidden
Have you tried it with a virtually-hosted site? It seems CFNetwork
reports 1.0, but still sends a Host: header; I tried a simple
initWithContentsOfURL:, watched it with ktrace, and the following was
sent:
GET / HTTP/1.0
User-Agent: CFNetwork/1.1
Host: www.withay.com:80
Connection: close
The proper HTML came back as well. Since unrecognized headers are simply
to be ignored in HTTP, those headers are legal for 1.0. Perhaps some
servers ignore them with 1.0 is used (my test was against Apache, so it
honors the Host: header with 1.0, and even sent back a 1.1 reply).
As far as why it reports 1.0, that's a good question...
Bryan
On May 24, 2003 16:41, Greg Hurrell stated:
>
I have just run into problems trying to use Cocoa to download things
>
from the web (using methods like NSString's initWithContentsOfURL and
>
others).
>
>
In my efforts to troubleshoot the problem I have seen from looking at
>
logs on my own webserver that attempts at downloading using Cocoa
>
produce entries like:
>
>
>www.xxx.yyy.zzz - - [24/May/2003:16:21:45 +0930] "GET /file.txt
>
>HTTP/1.0" 200 30194 "-" "CFNetwork/1.1" mod_gzip: 0pct.
>
>
If I hit the same URL in my browser the following log messages appear:
>
>
>www.xxx.yyy.zzz - - [24/May/2003:16:26:48 +0930] "GET /file.txt
>
>HTTP/1.1" 200 603 "-" "Mozilla/5.0 (Macintosh; U; PPC Mac OS X; es)
>
>AppleWebKit/74 (KHTML, like Gecko) Safari/74" mod_gzip: 0pct.
>
>
So it appears that "CFNetwork" (Cocoa) is making the request using
>
HTTP/1.0 instead of HTTP/1.1.
>
>
For a description of the differences between the two versions, see:
>
>
http://www.research.att.com/~bala/papers/h0vh1.html
>
>
For me, the key section is this:
>
>
>The Domain Name System (DNS) allows multiple host names to be bound to
>
>the same IP address. Unfortunately, because the original designers of
>
>HTTP did not anticipate the ``success disaster'' they were enabling,
>
>HTTP/1.0 requests do not pass the hostname part of the request URL.
>
>
As such, any attempt to access a URL on a host with multiple virtual
>
domains will fail.
>
>
Questions:
>
- Why is Cocoa using HTTP/1.0?
>
- Is there a way to force it to use HTTP/1.0?
>
>
Regards
>
Greg
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.