Closed Bug 168988 Opened 22 years ago Closed 22 years ago

HTTP should reject URLs that lack a hostname.

Categories

(Core :: Networking: HTTP, defect, P3)

defect

Tracking

()

VERIFIED FIXED
mozilla1.2beta

People

(Reporter: darin.moz, Assigned: darin.moz)

References

()

Details

(Keywords: topembed+)

Attachments

(1 file)

HTTP should reject URLs that lack a hostname.  Currently, if loading an URL via
a proxy server, the HTTP code will try to load URLs like "http:///" even though
we could easily determine that there is no hope that loading such an URL would
result in anything meaningful.
Keywords: topembed+
Status: NEW → ASSIGNED
Priority: -- → P3
Target Milestone: --- → mozilla1.2beta
As far as a proxy goes, I have to disagree. How the proxy resolves a URL
is up to the proxy. It's a black box. The client cannot acquire any
knowledge of what will happen.
tenthumbs: huh?  http:/// is a meaningless URL.  anyways, we're violating the
HTTP/1.1 protocol by not sending a Host: header, which cannot be sent in this
case.  i see no reason to send such a lame request to a proxy server.  as for
non-http requests, you could perhaps argue that blah:/// could mean something. 
i'm not sure if that is ok, because we'd still have the problem of what Host:
header to send.
I'm reasonably sure that even the very-contradictory uri spec requires a
hostname here...
Attached patch v1 patchSplinter Review
this patch verifies that the URL is not empty before generating the Host header
inside nsHttpChannel::Init.  so, there is very little cost to this check.  one
negative is that there is no user feedback for this error.  but that's
docshell's problem.
Keywords: patch
i of course meant:

this patch verifies that the _hostname_ is not empty before...
Comment on attachment 100685 [details] [diff] [review]
v1 patch

r=dougt
Attachment #100685 - Flags: review+
fixed-on-trunk
Status: ASSIGNED → RESOLVED
Closed: 22 years ago
Resolution: --- → FIXED
verified:  10/01/02 trunk, winNT4, linux rh6, mac osX
Status: RESOLVED → VERIFIED
So, you don't meant that "HTTP should reject URLs that lack a hostname" like 
this "http://129.21.2.233" as oppose to "http://www.rit.edu"?
nope, this check just avoids sending out a request for http:/// to a proxy server.
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: