Re: "Normalize" a URL
Re: "Normalize" a URL
- Subject: Re: "Normalize" a URL
- From: Joar Wingfors <email@hidden>
- Date: Sun, 28 Jan 2007 15:00:02 +0100
I would suggest that you locate and study the documentation for the
standards that governs how URLs are supposed to be constructed,
rather than code to match the quirks of some particular implementation.
Once you have a correct implementation, you might of course want to
add exceptions to be able to support some vendor that doesn't play by
the book - but the baseline should always be the documented standard.
If you have a good case for the need of this type of behaviour, and
if you can't find support for it in the Cocoa frameworks, you should
file enhancement requests via the Apple BugReporter.
j o a r
On Jan 28, 2007, at 1:11 PM, Filipe Cabecinhas wrote:
On 1/28/07, Jerry Krinock <email@hidden> wrote:
1) Last path component "/index.html" or "/index.htm" is changed
to "/".
You don't want this. You don't know what the priorities of the
webserver are. What if your URL is "/index.html" but the default the
webserver sends is "index.php"? You would remove the "index.html" from
the URL and, when you tried to read the page, you would get
"/index.php" and not "/index.html". Yes, it's a weird thing to
happen... But you can't garantee it won't happen. ;-)
3) Any uppercase letters are converted to lowercase.
You don't know if the server is case-sensitive. For example (this is
the only URL I know this happens):
http://www.sonymusic.com/artists/PearlJam
http://www.sonymusic.com/artists/Pearljam
The first one goes to the page. The second one gives a 404.
5) An empty query, that is, a "?" at the end of a URL, is removed.
I don't know if in PHP there's any difference between not passing a
query and passing an empty query (there may be differences)
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden