It seems that, for some reason, the CSP headers are not "attached" to paths ending in /, only to paths that include the full file name.
An example of a _headers configuration file generated by Astro-Shield, which includes the paths ending in / (it seems that doesn't work well 😢 ):
# The config for `/` does not work well
/
content-security-policy: script-src 'self' 'sha256-2WuRaoBDyP6+xwvZy812CbGbnJEtRyaQ+TISjVXfIkw='; style-src 'self' 'sha256-ZlgyI5Bx/aeAyk/wSIypqeIM5PBhz9IiAek9HIiAjaI='
# The config for `/es/` does not work well
/es/
content-security-policy: script-src 'self' 'sha256-tvf9zEN6xy3u/Aa9a9YzhAYtoMNT38Tkyx0bW1Z/UKk='; style-src 'self' 'sha256-J4U/wAKuxeFWuwWSV8kSYyq/CEW+Jvs2FCK8E2Palh8='
# The config for `/es/index.html` works as expected
/es/index.html
content-security-policy: script-src 'self' 'sha256-tvf9zEN6xy3u/Aa9a9YzhAYtoMNT38Tkyx0bW1Z/UKk='; style-src 'self' 'sha256-J4U/wAKuxeFWuwWSV8kSYyq/CEW+Jvs2FCK8E2Palh8='
# The config for `/index.html` works as expected
/index.html
content-security-policy: script-src 'self' 'sha256-2WuRaoBDyP6+xwvZy812CbGbnJEtRyaQ+TISjVXfIkw='; style-src 'self' 'sha256-ZlgyI5Bx/aeAyk/wSIypqeIM5PBhz9IiAek9HIiAjaI='
I'll have to confirm that this is really a bug... it might be that I didn't see the headers because the content was cached (and the content retrieved again).
It seems that, for some reason, the CSP headers are not "attached" to paths ending in
/
, only to paths that include the full file name.An example of a
_headers
configuration file generated by Astro-Shield, which includes the paths ending in/
(it seems that doesn't work well 😢 ):Related to #65 .