Closed Bug 203631 Opened 22 years ago Closed 14 years ago

Host header should not include the default port for compatibility with broken servers

Categories

(Core :: Networking, defect, P3)

defect

Tracking

()

RESOLVED WORKSFORME

People

(Reporter: dave, Unassigned)

References

()

Details

(Whiteboard: [have patch])

Attachments

(4 files, 1 obsolete file)

User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312 Build Identifier: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.3) Gecko/20030312 the url contains a Base64 encoded string (RFC 1521). It seems that the equals signs at the end of the string, are disturbing the request. the same url works fine with IE and Opera Reproducible: Always Steps to Reproduce: 1.just click on the provided link 2. 3. Actual Results: an error is provided by the application. Expected Results: a page should be displayed
Mozilla gives me following error message, Opera7 displays an empty page with a gif, seems correct if you look at the source. Mozilla/5.0 (Windows; U; Win98; en-US; rv:1.4b) Gecko/20030425 shows: Forbidden (403) You have requested data that the server has decided not to provide to you. Your request was understood and denied. Not Found (404) The file that you requested could not be found on this server. If you provided the URL, please check to ensure that it is correct. If you followed a hypermedia link, please notify the administrator of that server of this error.
-> HTTP
Assignee: asa → darin
Component: Browser-General → Networking: HTTP
QA Contact: asa → httpqa
Status: UNCONFIRMED → NEW
Ever confirmed: true
That url has a session ID embedded. If anyone tries to follow it, it'll just give a 403, since that person does not have the right IP for the session.
dave: can you capture packet traces of Mozilla and IE/Opera loading that page? there's a handy tool available from www.ethereal.com (available for windows and most platforms) that can help you do this. if you aren't able to do this, then no problem. but, it sure would help us if you could ;-) just save each capture to disk and upload the files to this bug report. thx!
as you wished
as you wished
as you wished
i added teh desired log files with the required tool ethereal
dave: awesome! thank you! i'll take a look to see what differs...
Status: NEW → ASSIGNED
Target Milestone: Future → mozilla1.5alpha
so, both opera and mozilla issue the exact same HTTP request line, but for some reason the server just doesn't like the full HTTP request from mozilla. one difference is the host header. mozilla sends this: Host: www.homegate.ch:80 while opera sends this: Host: www.homegate.ch this difference should not matter; however, i seem to recall fixing a bug well over a year ago to make sure that mozilla does not send the default port number in the Host header because of the fact that some servers misunderstand it. dave: can you try loading the URL without the ":80"?
darin, your right without the portnumber the request provides the correct result. so, what will be your next steps?
-> walter
Assignee: darin → waltershen
Status: ASSIGNED → NEW
Target Milestone: mozilla1.5alpha → mozilla1.5beta
Attached patch Patch (obsolete) — Splinter Review
Adds some code to avoid sending in the default port number (for both SSL and not SSL).
Attached patch patchSplinter Review
New Patch. Accomplishes the same things as the old one, but a little more efficiently.
Attachment #127832 - Attachment is obsolete: true
Comment on attachment 127913 [details] [diff] [review] patch Review, I think?
Attachment #127913 - Flags: review?(darin)
Comment on attachment 127913 [details] [diff] [review] patch r+sr=darin (looks good walter.. thx!)
Attachment #127913 - Flags: superreview+
Attachment #127913 - Flags: review?(darin)
Attachment #127913 - Flags: review+
Status: NEW → ASSIGNED
actually, i started thinking about this bug some more... and a question came up: why isn't the default port striped from the URL inside nsStandardURL::Init? it almost seems as if the URL has not been created properly. this bug is easily reproducible simply by loading http://anyhost:80/ and watching a network packet trace or HTTP log. one option would be to try to fix this by modifying the code in nsStandardURL::BuildNormalizedSpec to have it set mPort = -1 when mPort == mDefaultPort. i'm not sure if that would break other things yet... i need to think about it for a little while ;-)
Summary: the url contains a Base64 encoded string (RFC 1521) → Host header should not include the default port for compatibility with broken servers
sorry, this one slipped off my radar...
Assignee: waltershen → darin
Status: ASSIGNED → NEW
OS: Windows XP → All
Hardware: PC → All
Target Milestone: mozilla1.5beta → mozilla1.8alpha
Target Milestone: mozilla1.8alpha1 → mozilla1.8beta
Status: NEW → ASSIGNED
Whiteboard: [have patch]
Severity: normal → minor
Status: ASSIGNED → NEW
Priority: -- → P3
Target Milestone: mozilla1.8beta1 → mozilla1.8beta2
Target Milestone: mozilla1.8beta2 → mozilla1.9alpha
-> default owner
Assignee: darin → nobody
Component: Networking: HTTP → Networking
QA Contact: networking.http → networking
Target Milestone: mozilla1.9alpha → ---
testcase URL no longer works
Jason, Honza : Do you think that we should take the patch or if we still want to do a more general solution ?
> Do you think that we should take the patch or if we still want to do > a more general solution ? Patch doesn't apply--the Init code doesn't look like this any more at all. Are we even sure this is still an issue? No comments from users in 4 years, and the code has changed. Need to verify it's even still an open bug.
This seems to be wfm if I follow comment#17 and load http://host:80 either with the URL bar or as link in a html document. The port is stripped from the Host Header. Sorry for the noise
Status: NEW → RESOLVED
Closed: 14 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: