Forum

ShowIndex mode and files with '+' in name

yanfali@gmail.com
30 October 2012, 06:24

Hiawatha version: Hiawatha v8.5, cache, IPv6, Monitor, reverse proxy, SSL, Tomahawk, URL toolkit, XSLT
Operating System: Debian Wheezy

Hello,

I'm trying to debian apt http repository using a hiawatha virtual host, and I've run into a curious corner case when using ShowIndex.
VirtualHost {
Hostname = apt.mynetwork.com
WebsiteRoot = /data/debian-repo
ShowIndex = yes
FollowSymlinks = yes
}

I'm using a tool called jenkins-debian-glue and it generates filenames like

jenkins-debian-glue_0.4.0+0~1351535057.10~1.gbpf6a3ab_all.deb

When apt tries to retrieve those files while being served by hiawatha a 404 is returned. And this is in the access log:

10.101.2.36|Mon 29 Oct 2012 13:27:32 -0700|404|849||GET /apt/pool/main/j/jenkins-debian-glue/jenkins-debian-glue_0.4.0+0%7e
1351535057.10%7e1.gbpf6a3ab_all.deb HTTP/1.1|Host: apt.sm.edgespring.com|Connection: keep-alive|User-Agent: Debian APT-HTTP
/1.3 (0.9.7.5)

If I install nginx on port 8000 and change sources.list to reflect this change I can get the file via apt-get and the log looks like this:

10.101.2.36 - - [29/Oct/2012:22:08:46 -0700] "GET /apt/pool/main/j/jenkins-debian-glue/jenkins-debian-glue_0.4.0+0%7e1351535057.10%7e1.gbpf6a3ab_all.deb HTTP/1.1" 200 17900 "-" "Debian APT-HTTP/1.3 (0.9.7.5)"

The only way I can use hiawatha to serve files via apt-get is if I remove all '+' symbols from the file name. Somehow nginx and apache are both able to resolve the GET request when indexes are enabled and hiawatha isn't. Is this a bug or have I just misconfigured hiawatha?

Thanks

Yan
Hugo Leisink
30 October 2012, 08:19
It seems to be the left-over of a work-around for strange browser behaviour a long time ago. It will be fixed in the next release. In the meantime, remove line 305 and 306 from libstr.c and remove the '} else ' from line 307.
Yan-Fa Li
30 October 2012, 17:25
Thanks. I'll try that and let you know.
Yan-Fa Li
30 October 2012, 19:31
Works! Thanks.
Hugo Leisink
30 October 2012, 19:37
You're welcome.
This topic has been closed.