httpfs2 does case sensitve comparison of http headers

Bug #1043544 reported by nik.martin
6
This bug affects 1 person
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
ProcVersionSignature: Ubuntu 3.2.0-29.46-generic-pae 3.2.24
Uname: Linux 3.2.0-29-generic-pae i686
NonfreeKernelModules: wl
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)

Revision history for this message
nik.martin (nik-martin) wrote :
description: updated
Revision history for this message
Michal Suchanek (hramrach) wrote :

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

Revision history for this message
Michal Suchanek (hramrach) wrote :

Can you try the package from https://launchpad.net/~hramrach/+archive/ppa

Thanks

Revision history for this message
nik.martin (nik-martin) wrote : Re: [Bug 1043544] Re: httpfs2 does case sensitve comparison of http headers

It works!

Regards,

Nik

On Fri, Aug 31, 2012 at 8:18 AM, Michal Suchanek <email address hidden> wrote:
> Can you try the package from
> https://launchpad.net/~hramrach/+archive/ppa
>
> Thanks
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1043544
>
> Title:
> httpfs2 does case sensitve comparison of http headers
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/httpfs2/+bug/1043544/+subscriptions

Revision history for this message
Michal Suchanek (hramrach) wrote :

Thanks for testing.

I don't know any web server broken in this way.

The nginx home page uses proper capitalization.

Revision history for this message
nik.martin (nik-martin) wrote :

Drop box does, which is a perfect candidate for this type of driver. I
store my .vimrc up there and use this driver :-) Drop box probably uses a
custom build.

Thanks again,

Nik
On Sep 5, 2012 6:30 AM, "Michal Suchanek" <email address hidden> wrote:

> Thanks for testing.
>
> I don't know any web server broken in this way.
>
> The nginx home page uses proper capitalization.
>
> --
> You received this bug notification because you are subscribed to the bug
> report.
> https://bugs.launchpad.net/bugs/1043544
>
> Title:
> httpfs2 does case sensitve comparison of http headers
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/httpfs2/+bug/1043544/+subscriptions
>

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.