freifunkh / ansible

Here we store all Ansible roles and configs used for Freifunk Hannover.
MIT License
7 stars 3 forks source link

web: only redirect if path matches exactly #269

Closed herbetom closed 1 month ago

herbetom commented 1 month ago

otherwise a file like download.html in / will also match the /download location

https://github.com/freifunkh/ansible/pull/268#issuecomment-2118839084

maybe make sure that the jinja can handle the = modifier, haven't looked into that

1977er commented 1 month ago

No need. I just renamed the download.html file. But thanks anyway. :) I learned some syntax today.

herbetom commented 1 month ago

Okay. Personally i would still fix it just so that nobody tries copying it and runs into the same situation. But your call. :)

At least the concept of only matching exactly with the = works:

without the fix:

$ curl https://fw.ff.tomhe.de/images.html
<html>
<head><title>301 Moved Permanently</title></head>
<body>
<center><h1>301 Moved Permanently</h1></center>
<hr><center>nginx</center>
</body>
</html>

with the fix

$ curl https://fw.ff.tomhe.de/images.html
Test

in both cases there was a images.html in /.