Prefix middleware keeps on appending slashes

Issue #742 resolved
Gili
created an issue

I am using this prefix middleware in my configuration:

[filter:proxy-prefix]
# prefix middleware for rc
use = egg:PasteDeploy#prefix
prefix = /hg

[app:main]
use = egg:rhodecode
filter-with = proxy-prefix

When I hit http://localhost/hg/ it works fine. But when I hit http://localhost/hg// (notice the double slash) I get redirected over and over again with an extra slash added each time.

Comments (4)

  1. Marcin Kuzminski repo owner

    Very odd it doesn't seems to be related to RhodeCode rather how the browser behaves. There's nothing in the logs and If i turn off RhodeCode server completely the slash redirection still happens.

  2. Gili reporter

    The browser is not at fault. If you invoke wget http://foo.com/hg// you'll get:

    HTTP request sent, awaiting response... 301 Moved Permanently
    Location: https://foo.com/hg/// [following]
    --18:58:42--  https://foo.com/hg///
    

    and so on. The Location header returned by Rhodecode is wrong.

  3. Log in to comment