httpfs2 does case sensitve comparison of http headers
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Httpfs2 |
New
|
Undecided
|
Unassigned | ||
httpfs2 (Ubuntu) |
New
|
Undecided
|
Unassigned |
Bug Description
The http host headers for Accept-Ranges, etc. are not case sensitive, so a case insensitive comparison should be done:
This is how httpfs2 looks for the string "Accept-Ranges: Bytes"
static int mempref(const char * mem, const char * pref, size_t size)
{
/* return true if found */
if (size < strlen(pref)) return 0;
return ! memcmp(mem, pref, strlen(pref));
}
nginx servers return this:
HTTP/1.1 200 OK
Server: nginx/1.0.14
Date: Wed, 29 Aug 2012 21:45:33 GMT
Content-Type: text/plain; charset=ascii
Connection: keep-alive
content-length: 9871
x-robots-tag: noindex,nofollow
accept-ranges: bytes
etag: 1486n
pragma: public
cache-control: max-age=0
so the string comparison should do a case insensitive string comparison.
I will add a patch later, but I'm on to nother project at the moment that is a higher priority. The project is dead on sourceforge
ProblemType: Bug
DistroRelease: Ubuntu 12.04
Package: httpfs2 0.1.4-1ubuntu1
ProcVersionSign
Uname: Linux 3.2.0-29-
NonfreeKernelMo
ApportVersion: 2.0.1-0ubuntu12
Architecture: i386
Date: Wed Aug 29 16:50:07 2012
InstallationMedia: Ubuntu 12.04 LTS "Precise Pangolin" - Release i386 (20120423)
ProcEnviron:
SHELL=/bin/bash
TERM=xterm
PATH=(custom, user)
LANG=en_US.UTF-8
SourcePackage: httpfs2
UpgradeStatus: No upgrade log present (probably fresh install)
Nice catch.
This works in practice because most servers follow the reccommendation and send headers with correct capitalization.
You can try the hg tip from SF to see if it works with the nginx server. Unfortunately, the patch does not apply to Ubuntu package.
Thanks