Forum

ReverseProxy 9.10 and 9.11 regression: Space in URL

Klemens Schölhorn
28 January 2015, 22:09
Hi!

Today I upgraded from hiawatha 9.9 to 9.11 and some files on my seafile instance that I access through the ReverseProxy function were no longer downloadable.
The connection just did not return anything ("Server returned 0 bytes" in Fiddler) until the browser hit its timeout.

It turned out that this only happens with urls with spaces in them:

https://files.sync.domain.tld/files/0d9d9e7b-09f3-41d8-840c-0b22ef76eda1/Ablauf%20Bachelor.png

Does not work.

https://files.sync.domain.tld/files/0d9d9e7b-09f3-41d8-840c-0b22ef76eda1/AblaufBachelor.png

Does work without problems.

The log file has an identical 200 entry in both cases

I don't have anything unusual in my virtual host:
VirtualHost { # seahub files
Hostname = files.sync.domain.tld
WebsiteRoot = /srv/http/sync.domain.tld/www
SSLcertFile = /etc/hiawatha/certs/files.sync.domain.tld.pem
RequireSSL = true
ReverseProxy .* http://127.0.0.1:8082 3600
AccessLogfile = /srv/http/sync.domain.tld/log/file-access.log, weekly
ErrorLogfile = /srv/http/sync.domain.tld/log/file-error.log
}


Hiawatha is running under arch with linux 3.14.29 and the problem occurs with firefox and chrome. 9.10 also seems affected.

Kind regards
Klemens
Hugo Leisink
29 January 2015, 14:59
It's a small bug in Hiawatha. In src/workers.c at line 697, change
    url_decode(session->uri);
session->uri_len = strlen(session->uri);

to
    if (rproxy == NULL) {
url_decode(session->uri);
session->uri_len = strlen(session->uri);
}
Klemens Schölhorn
1 February 2015, 23:33
I just applied the patch to my server and it works flawlessly now!

Thanks for your fast reply and solution!
This topic has been closed.