Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > WebKit and Request Headers

WebKit and Request Headers
Thread Tools
Fresh-Faced Recruit
Join Date: May 2001
Location: USA
Status: Offline
Reply With Quote
Jul 13, 2003, 03:43 PM
 
I thought it would be pretty cool if I could use WebKit to connect to an IP address and send a custom host header to tell the server which site I want to see. Apparently, Apple has better ideas.

NSURL *myURL = [[NSURL alloc] initWithScheme:@"http" host:@"127.0.0.1" path:@"/index.html"];

NSMutableURLRequest *myRequest = [[NSMutableURLRequest alloc] initWithURL:myURL];

[myRequest setValue:@"www.apple.com" forHTTPHeaderField:@"Host"];

When I screw up the last line, say, by adding a colon after "Host" Apache complains about a malformed Host header.

When I don't screw it up, WebKit seems to ignore it completely and I get the default web site (Verified by my phpinfo.php page which lists $_SERVER["HTTP_HOST"] as "127.0.0.1").

I really hope someone can offer some insight into this problem and how to fix it, because I am at a loss.

Thanks,
Andy Kvochick
(Last edited by Chiznibitz; Jul 16, 2003 at 08:03 PM. )
     
Fresh-Faced Recruit
Join Date: May 2001
Location: USA
Status: Offline
Reply With Quote
Jul 16, 2003, 08:04 PM
 
I still haven't made any headway on this. Does anyone else have any experience with WebKit?
     
Forum Regular
Join Date: Nov 2002
Location: PVD/MSP
Status: Offline
Reply With Quote
Jul 17, 2003, 01:50 AM
 
Have you tried your question in the webkit/webcore dev mailing lists?

http://lists.apple.com/mailman/listinfo

They would probably be helpful...

Good luck!
dearinter.net consensus life coaching.
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 02:10 PM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2