Subject: semantic equivalence of delimiters in URIs

From: Adrien de Croy <[email-masked]>
Date: Thu, 17 Jun 2010 14:10:10 +1200

whilst debugging another issue, I came across evidence of a client 
sending proxy-style requests with URIs in the form

http://somesite.com?id=somequeryparameter

It struck me as odd that a client should be capable of sending such a 
request (missing resource - no '/' )

I read through RFC 2396 which seems to cover such things, and found in s 
3.2 Authority component

The authority component is preceded by a double slash "//" and is
    terminated by the next slash "/", question-mark "?", or by the end of
    the URI.

I tested several browsers to see if they would permit entering a URI in 
this form.  None that I tested would allow it, and all inserted a 
forward slash between the end of the authority, and the questionmark.

So my question then, are the following 2 request URIs actually 
semantically equivalent?

http://somesite.com?id=somequeryparameter
http://somesite.com/?id=somequeryparameter

If these are not equivalent, it could be considered non-compliant to 
rewrite the request to include the slash.

Regards

Adrien de Croy

---

From: "William A. Rowe Jr." <[email-masked]>
Date: Thu, 17 Jun 2010 02:33:03 -0500

> http://somesite.com/?id=somequeryparameter

Perhaps we ask the spec?

"If the abs_path is not present in the URL, it MUST be given as "/" when
used as a Request-URI for a resource (section 5.1.2)."

"An empty abs_path is equivalent to an abs_path of "/"."

Now if you aren't asking about http:, but another scheme, the question can
get muddy really fast.

---

From: Henrik Nordström <[email-masked]>
Date: Sat, 19 Jun 2010 20:39:27 +0200

> Now if you aren't asking about http:, but another scheme, the question can

And it's muddy even for HTTP where an empty abs-path can also mean "*".

Regards
Henrik

---

From: "William A. Rowe Jr." <[email-masked]>
Date: Mon, 21 Jun 2010 01:27:48 -0500

> And it's muddy even for HTTP where an empty abs-path can also mean "*".

No, "*" has a specific meaning, which is distinct from "" / "/", as described
under OPTIONS.

---

From: Henrik Nordström <[email-masked]>
Date: Mon, 21 Jun 2010 09:58:44 +0200

> No, "*" has a specific meaning, which is distinct from "" / "/", as described

Well.. (RFC2068, and resurrected in HTTP-bis)

   If a proxy receives a request without any path in the Request-URI and
   the method specified is capable of supporting the asterisk form of
   request, then the last proxy on the request chain MUST forward the
   request with "*" as the final Request-URI. For example, the request

          OPTIONS http://www.ics.uci.edu:8001 HTTP/1.1

Regards
Henrik