Opened 11 years ago

Closed 11 years ago

#997 closed defect (fixed)

uri-path-relative? misunderstands the root path

Reported by: andyjpb Owned by: sjamaan
Priority: major Milestone: someday
Component: extensions Version: 4.8.x
Keywords: Cc:
Estimated difficulty:

Description (last modified by sjamaan)

(use uri-common)

#;16> (uri-path-relative? (uri-reference "http://www.knodium.com"))
#t
#;17> (uri-path-relative? (uri-reference "http://www.knodium.com/"))
#f

Change History (3)

comment:1 Changed 11 years ago by sjamaan

Description: modified (diff)
Owner: set to sjamaan
Status: newaccepted

comment:2 Changed 11 years ago by sjamaan

This has been fixed in trunk. Please give it a try.

I didn't really know what to do with the "foo" case: strictly speaking, this can't be subject to the scheme-based normalization rules of section 6.2.3 (RFC 3986), because we don't have a scheme.

On the other hand, this egg already makes some hard assumptions about the type of URI (for example, it assumes the query part *must* be form-encoded, as key/value pairs) so perhaps this wouldn't be so bad? It would be breaking with the spec, though.

Because I wasn't sure, I kept the behavior the way it was (ie, (uri-path (uri-reference "foo")) returns '() instead of '(/ ""), making it inconsistent with cases where we do know the scheme).

Perhaps we should be checking that the URI really is a common URI (ie, has a known scheme listed in default-ports), and failing otherwise? This would be obnoxious but possible and prevent more errors being made, but might cause some problems of its own. Gah!

comment:3 Changed 11 years ago by andyjpb

Resolution: fixed
Status: acceptedclosed

Super! Thanks!

Note: See TracTickets for help on using tickets.