Hi,

I don't know how stupid of a question this is, but it was worth a hack for
me, so maybe other users might benefit from it too.

It seems that some servers are broken and in order to fetch files with certain
filenames, some characters that are normally encoded in HTTP sequences must
be sent through unencoded.  For example, I had a server the other day that
I was fetching files from at the URL:
http://server.com/~foobar/files

Sending the normal request for
GET /%7Efoobar/files

caused the server to return a 404.  However, I hacked wget and added a
"noencodetilde" option, and changed the following line around url.c:109:

#define UNSAFE_CHAR(c) (urlchr_test(c, urlchr_unsafe))

to:
#define UNSAFE_CHAR(c) (urlchr_test(c, urlchr_unsafe) && !(&opt.noencodetilde && 
c=='~'))

This caused the tilde to be sent through unencoded, and the files were fetched
properly.

The reason I mention this is that perhaps a general option to give wget a list
of characters not to encode (that would normally be encoded) would be useful
in fetching files from corner cases such as this.

Thanks!

-- 
Ryan Underwood, <nemesis at icequake.net>, icq=10317253

Reply via email to