Mantis Bugtracker

Viewing Issue Simple Details Jump to Notes ] View Advanced ] Issue History ] Print ]
ID Category Severity Reproducibility Date Submitted Last Update
0006493 [Squeak] Network minor always 05-19-07 19:35 05-19-07 19:35
Reporter Boingo View Status public  
Assigned To cdegroot
Priority normal Resolution open  
Status assigned   Product Version 3.9
Summary 0006493: HTTP redirects use the IP instead of hostname causing servers that use the hostname to fail
Description Server based HTTP redirects (for example a 302 response) in Squeak use the IP address of the original response to make the second request (the redirected page). The call:

httpGetDocument: url args: args accept: mimeType request: requestString

in the HTTPSocket class, calls:

newUrl _ self expandUrl: newUrl ip: serverAddr port: connectToPort.

upon detection of a 3xx response (a redirect response). expandUrl takes an IP and not a hostname to determine the new url for the redirect. Since a url that beings with an IP address is returned and then passed to the httpGetDocument a second time (for the redirect), when the:

sock sendCommand: ...

command is called for the second time (the redirect), the serverName is now an IP address and not a hostname. Some servers serve their pages based on the hostname passed (for example; virtual hosting, or multiple sites on one IP) and so require that the hostname be passed to know which page to serve. Browsers seem to do this just fine, but as the expandUrl returns a URL based on IP:Port the server returns an error (usually a 404).

For example:

'' [^] has its IP resolved to, so the request is to '', [^] but the serverName field is set correctly, so the server returns the redirect response. The redirect is recognized, and the IP and location are passed to the expandUrl method, which returns '' [^] but the serverName variable is not set to the domain name. The server does not have that hostname set properly and so the request fails.
Additional Information
Attached Files

- Relationships

There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
05-19-07 19:35 Boingo New Issue
05-19-07 19:35 Boingo Status new => assigned
05-19-07 19:35 Boingo Assigned To  => cdegroot
06-03-07 08:57 ykoubo Issue Monitored: ykoubo

Mantis 1.0.8[^]
Copyright © 2000 - 2007 Mantis Group
33 total queries executed.
28 unique queries executed.
Powered by Mantis Bugtracker