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: Greg Hurrell <email@hidden>
- Date: Sat, 24 May 2003 18:26:46 +0930
Yes, I've tried it with several virtually-hosted sites.
Most work, because, as you've pointed out, the "Host:" header is sent
as well. Others fail. The ones which fail seem to be those that do
host-based processing with Apache's mod_rewrite...
So although this is a limitation in Cocoa (for using HTTP/1.0), it's
probably an indicated of a bug in mod_rewrite that it ignores the Host
header in HTTP/1.0 requests even if it is present.
Cheers
Greg
El Saturday, 24 May, 2003, a las 17:04 Australia/Adelaide, Bryan
Blackburn escribis:
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.
_______________________________________________
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.