-
-
Notifications
You must be signed in to change notification settings - Fork 4.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
404 on filenames with accents #4329
Comments
@bmichotte Would you be able to try the proposed fix in #4332? |
You can grab the CI build artifacts from here: https://github.com/caddyserver/caddy/actions/runs/1201538520 |
@mholt I can try but as this is a production server I need to duplicate it, so I’ll try to do that tomorrow |
@mholt @mohammed90 I can confirm that the patch provided fixes the issue, the images are loading ! |
Sorry to weigh in here, but I think with #4332 and #4409 the path handling is now wrong and paths end up double encoded and markdown rendering does not work anymore for me. Consider the following example:
template.html: {{$markdownFilePath := .OriginalReq.URL.Path}}
{{$markdownFile := (include $markdownFilePath | splitFrontMatter)}}
<html>
<head>
<title>Awesome Markdown</title>
</head>
<body>
{{markdown $markdownFile.Body}}
</body>
</html> Now I have a file <td>
<a href="test%2520test.md">
<svg width="1.5em" height="1em" version="1.1" viewBox="0 0 265 323"><use xlink:href="#file"></use></svg>
<span class="name">test test.md</span>
</a>
</td> The URL is
(German windows over here, "Das System kann die angegebene Datei nicht finden." means "File not found.") I think the OPs problem is the wrong encoding of the path Btw: Both file name I don't know what the OPs real problem was, but it was not caddy's path encoding. Please consider reverting the changes from #4332 and #4409. |
@mohammed90 It is not fixed in 1e10f6f. Edit: Sorry to be so stubborn on this. Like I said: I think is was fine before #4332 and #4410. |
No worries. I also tend to be quite assertive, stern, and stubborn in my observations and communication 😄 I didn't read your comment in any negative manner. I can't look at this now. It'll take me perhaps until the weekend. |
You're right, @ueffel. The tests still pass without the changes (says something about writing tests first 🙂, which I didn't), yet we still need the patch from 1e10f6f. I will send a PR that reverts the changes of #4332 but retains the tests. Ironically, this issue report wasn't valid, but the supposed fix made it tangentially valid. |
78b5356 looks good to me. Thanks. |
Looks good to me as well ! |
Awesome. Thanks so much for patching, @mohammed90, and for your help everyone. |
Hi there,
Caddy gives me an error 404 for files with accents like
cropped-Capture-d’écran-2019-12-02-à-16.22.37.png
(yes, I know, this is awfull), which are calledcropped-Capture-d%E2%80%99%C3%A9cran-2019-12-02-%C3%A0-16.22.37.png
by the browser.Obviously the file does exists and the files without accents gives a
200 OK
.Log file is
The config file is the following
The text was updated successfully, but these errors were encountered: