You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I've tried to use the custom headers feature. They work for files, but not for directories, although requesting a directory leads to its index.html. To be more precise, a config entry with "path": "*", "fileExtension": "html" does apply when requesting /path/index.html, but does not for /path, although the response body is the same.
shows that the middleware applies to the URL. Would it be possible to apply to the resolved file instead?
As a side note, I believe path + fileExtension should be superseded by a path glob or a regex, which is more powerful, and is actually not more complex. For instance, a rule with glob /**/ or regex \/$ would apply to any directory, and a rule with glob /**/*.css (or maybe even *.css) or regex \.css$ would apply to any CSS file.
The text was updated successfully, but these errors were encountered:
I'm willing to! I saw not-replied issues and wasn't sure you were still maintaining the project.
In order not to work for nothing, will you consider a PR that takes indexes into account, and I think it's better to open another one to add glob/regex to rules? I would not remove the current path + fileExtension to stay backward compatible.
I'm willing to! I saw not-replied issues and wasn't sure you were still maintaining the project.
Oups, I missed some notifications it seems.
In order not to work for nothing, will you consider a PR that takes indexes into account, and I think it's better to open another one to add glob/regex to rules? I would not remove the current path + fileExtension to stay backward compatible.
Hi, thanks for your image.
I've tried to use the custom headers feature. They work for files, but not for directories, although requesting a directory leads to its
index.html
. To be more precise, a config entry with"path": "*", "fileExtension": "html"
does apply when requesting/path/index.html
, but does not for/path
, although the response body is the same.The code at
goStatic/customHeaders.go
Line 88 in 131f492
As a side note, I believe path + fileExtension should be superseded by a path glob or a regex, which is more powerful, and is actually not more complex. For instance, a rule with glob
/**/
or regex\/$
would apply to any directory, and a rule with glob/**/*.css
(or maybe even*.css
) or regex\.css$
would apply to any CSS file.The text was updated successfully, but these errors were encountered: