Caddy: Caddy cannot handle mixed-case paths in server addresses

Created on 30 Aug 2017  路  5Comments  路  Source: caddyserver/caddy

1. What version of Caddy are you using (caddy -version)?

0.10.7

2. What are you trying to do?

Use a mixed-case path prefix

3. What is your entire Caddyfile?

http://test3.pjeby.com/XXX-foo {
    proxy / http://fpm_server_1/xxx {
        transparent
    }
}

4. How did you run Caddy (give the full command and describe the execution environment)?

caddy --conf /etc/Caddyfile --log stdout

5. Please paste any relevant HTTP request(s) here.

6. What did you expect to see?

Caddy should recognize requests to test3.pjeby.com/XXX-foo -- but it lowercases XXX-foo to xxx-foo and only accepts the lowercase version of the path.

7. What did you see instead (give full error messages and/or log)?

caddy_1 | 2017/08/30 03:36:51 https://test3.pjeby.com/xxx-foo

8. How can someone who is starting from scratch reproduce the bug as minimally as possible?

Create a caddyfile with an address ending with a mixed-case path, then try to access that path. Caddy's log shows a lowercased version, and responds to the mixed case version with a 404, saying that the site "is not served on this interface".

The relevant code is likely here, where key is lowercased before passing it to standardizeAddress(), instead of standardizing the original path as given.

duplicate

Most helpful comment

If you didn't spot it, there was this PR https://github.com/mholt/caddy/pull/1522 which was a proposed fix, but it got closed due to inactivity. If you'd like to work on continuing that fix, would be awesome 馃槃

All 5 comments

I think this is a duplicate of https://github.com/mholt/caddy/issues/1517 ?

^ Yep, looks like it. (Would like some help with that, incidentally. :smile:) Thanks for following the issue template!

My bad; I searched for "lowercase" and didn't find it.

Haha! I searched for "uppercase" (but also I remembered seeing a similar issue)

If you didn't spot it, there was this PR https://github.com/mholt/caddy/pull/1522 which was a proposed fix, but it got closed due to inactivity. If you'd like to work on continuing that fix, would be awesome 馃槃

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jgsqware picture jgsqware  路  3Comments

aeroxy picture aeroxy  路  3Comments

lorddaedra picture lorddaedra  路  3Comments

dafanasiev picture dafanasiev  路  3Comments

klaasel picture klaasel  路  3Comments