Re: URL syntax

2009-08-26 Thread Dan Jenkins
Ben Scott wrote:
  On Tue, Aug 25, 2009 at 7:48 PM, Dan Jenkinsd...@rastech.com wrote:
  Does the URL show properly in Thunderbird but then get messed up
  when Firefox gets it?
  Yes. If I recollect, it looked right in Thunderbird, but opening it
   caused a failure in Firefox.

  Curiouser and curiouser.  If I copy-and-paste the URL to a text
  editor, confirm the ampersand, then CP back to Firefox, it works
  properly.  If I manually type an ampersand as a Wikipedia URL, I get
  the appropriate redirect.  So Firefox does the right thing for me.
  Maybe it's the interaction between FF and TB?

  I've deleted the email, so I cannot do any further testing.

  If you want to do more testing, the URL was:

  http://en.wikipedia.org/wiki/Fast_Search__Transfer

  If you don't want to do more testing, that's okay, too.  =-)

This URL worked fine for me. No idea why it came through broke the first 
time. If I recollect it was not the  encoding which was broke, but that 
there was a break in the URL. When I searched for the partial URL on 
Wikipedia, I found the right URL, which, when I posted it in my email, 
encoded the  as %26. This is purely from memory, during a very busy 
day, whilst concentrating on something else, so my memory may have no 
resemblance to reality. :-D

--
Dan Jenkins, Rastech Inc., 1-603-206-9951





___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


URL syntax (was: ComCast DNS hijacking)

2009-08-25 Thread Ben Scott
On Tue, Aug 25, 2009 at 1:36 PM, Michael ODonnell
michael.odonn...@comcast.net wrote:
 I definitely transmitted a literal ampersand in the URL in the
 original message ...

  That's what Gmail shows me, too, even with Show original.  Gmail
can be a bit funky, but I think it's telling the truth in this case.

 (cut'n'pasted right out of Firefox's address bar)

  Be aware that for some browsers (including Firefox), what you see in
the address bar may not be the URL as the protocol processes it.
Firefox will show you the decoded result (complete with characters not
allowed), but send the encoded version, and if you copy to clipboard,
you get the encoded version.  This is generally what you want, but it
occasionally leads to confusion.  Since you clipboarded it anyway,
this shouldn't be one of those times.

 ... no MIME encoding or anything like that was involved.

  FWIW, the %00 notation is not something MIME knows about.  AFAIK, it
was invented for WWW, and is just called URL encoding.

 Is it bad form to use literal ampersands in emailed URLs?

  I wanted to say that ampersands are reserved in URLs, but I just
checked, and official sources seem to say they are allowed.

  The original Mar 1994 URL specification calls ampersand safe, and
does not place it in the reserved character list.
http://www.w3.org/Addressing/URL/url-spec.txt

  RFC-1738 (Dec 1994) says ampersand *may* be reserved in some
schemes, but specifically allows it in HTTP host paths.
http://tools.ietf.org/html/rfc1738

  RFC-3986 (Jan 2005) says host paths consists of segments, and
segments consist of pchar's, and pchar's include sub-delimiters, and
an ampersand is a sub-delimiter.  It also states that the semantics of
query parameters are outside of the scope of the URI spec, beyond the
use of question-mark (?) to separate the query from the path.  It even
specifically mentions that the equals sign, as with field=value, is
not part of that spec.  http://tools.ietf.org/html/rfc3986

  The ampersand/equals syntax used in HTML forms submitted via GET
appear to be defined by the HTML specification, as
application/x-www-form-urlencoded.  It's not mentioned anywhere else
that I can find.
http://www.w3.org/TR/html401/interact/forms.html#h-17.13.4

  So all that suggests that an ampersand is perfectly legal in a URL.
So I guess the failure is in software at Dan's end.

  It may be worth noting that ampersand is reserved in
{SG,HT,X,XHT}ML, so you can't put a URL containing an ampersand in an
HTML document literally; you have to encode the ampersand as an *ML
character entity (amp;).

  In general, I suggest avoiding everything but letters, numbers,
dashes, periods, and underscores in URL path components, for just this
sort of reason.

-- Ben
___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: URL syntax (was: ComCast DNS hijacking)

2009-08-25 Thread Ben Scott
On Tue, Aug 25, 2009 at 7:13 PM, Dan Jenkinsd...@rastech.com wrote:
  So I guess the failure is in software at Dan's end.

 Which is Thunderbird 2.0.0.22 and Firefox 3.5.2. Odd behavior, as I've
 never seen it before. But then, I've never seen an ampersand in a URL
 that wasn't encoded.

  Does the URL show properly in Thunderbird but then get messed up
when Firefox gets it?  Or is Thunderbird not recognizing the URL
properly when it sees it?  You might be able to figure out which one
is confused by looking for a copy URL option in Thunderbird, and
pasting to a text editor.

  Likewise, if you have URL with ampersand in it in the text editor,
and copy-and-paste to Firebird, does that work?

  Actually, thinking about it, the ampersand really shouldn't be
causing trouble *anyway*, since they show up all the time in URLs
which are CGI requests.  I suppose if something is looking for the
question-mark that indicates a CGI query in order to parse fields it
could cause trouble, but WTF would a mail client be doing that for?

  Maybe Thunderbird uses an HTML display widget, and is wrapping plain
text in HTML to display plain text, and didn't escape the ampersand in
the URL in the HTML?  (Again, ampersands may be legal literals in a
URL, but they're reserved in HTML, so URLs using ampersands which
appear in HTML must escape/encode  the ampersands.)

-- Ben

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: URL syntax

2009-08-25 Thread Dan Jenkins
Ben Scott wrote:
  On Tue, Aug 25, 2009 at 7:13 PM, Dan Jenkinsd...@rastech.com wrote:
  So I guess the failure is in software at Dan's end.
  Which is Thunderbird 2.0.0.22 and Firefox 3.5.2. Odd behavior, as
  I've never seen it before. But then, I've never seen an ampersand
  in a URL that wasn't encoded.

  Does the URL show properly in Thunderbird but then get messed up when
  Firefox gets it? 

Yes. If I recollect, it looked right in Thunderbird, but opening it 
caused a failure in Firefox.
I've deleted the email, so I cannot do any further testing.

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/


Re: URL syntax

2009-08-25 Thread Ben Scott
On Tue, Aug 25, 2009 at 7:48 PM, Dan Jenkinsd...@rastech.com wrote:
  Does the URL show properly in Thunderbird but then get messed up when
  Firefox gets it?

 Yes. If I recollect, it looked right in Thunderbird, but opening it
 caused a failure in Firefox.

  Curiouser and curiouser.  If I copy-and-paste the URL to a text
editor, confirm the ampersand, then CP back to Firefox, it works
properly.  If I manually type an ampersand as a Wikipedia URL, I get
the appropriate redirect.  So Firefox does the right thing for me.
Maybe it's the interaction between FF and TB?

 I've deleted the email, so I cannot do any further testing.

  If you want to do more testing, the URL was:

http://en.wikipedia.org/wiki/Fast_Search__Transfer

  If you don't want to do more testing, that's okay, too.  =-)

-- Ben

___
gnhlug-discuss mailing list
gnhlug-discuss@mail.gnhlug.org
http://mail.gnhlug.org/mailman/listinfo/gnhlug-discuss/