|Anonymous | Login||12-01-2021 21:37 UTC|
|Main | My View | View Issues | Change Log | Docs|
|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|
|Summary||0006493: HTTP redirects use the IP instead of hostname causing servers that use the hostname to fail|
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).
'http://www.example.com/pagethatgetredirected' [^] has its IP resolved to 22.214.171.124, so the request is to 'http://126.96.36.199:80/pagethatgetsredirected', [^] 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 'http://188.8.131.52/newpage' [^] 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.
|There are no notes attached to this issue.|
|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.