Skip to content
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

WebServer.serveStatic: index.html.gz as default doesn't work (while index.html does) #6984

Closed
JasperHorn opened this issue Jan 4, 2020 · 3 comments · Fixed by #7069
Closed

Comments

@JasperHorn
Copy link
Contributor

JasperHorn commented Jan 4, 2020

Apologies for forgoing the prescribed format. I noticed this problem while reading the code and though I did test it, that does make things like hardware information irrelevant. I decided to cut out that noise instead. (The issue that this is related to also didn't follow that format...)


Using index.html instead of index.htm for the "folder" is supported since 9f2cfb8

At that time, the lookup order became:

  1. index.htm
  2. index.html
  3. index.html.gz

As #6792 pointed out, this broke support for index.htm.gz and this was changed in 6768116 . The lookup order now is:

  1. index.htm
  2. index.html
  3. index.htm.gz

However, this has removed support for using index.html.gz completely. I think the lookup order should include four items:

  1. index.htm
  2. index.html
  3. index.htm.gz
  4. index.html.gz

(Perhaps with 2 & 3 reversed.)

@devyte
Copy link
Collaborator

devyte commented Jan 27, 2020

2 and 3 should be reversed.
Can you please make a PR with your suggestion?

@earlephilhower
Copy link
Collaborator

2 and 3 should be reversed

I would humbly suggest that anyone evil enough to have both a index.htm.gz and a index.html and expect for a sane solution gets the randomness they deserve.

earlephilhower added a commit to earlephilhower/Arduino that referenced this issue Feb 9, 2020
Fixes esp8266#6984

When a directory index is requested with an explicit index.html, follow
the original webserver order and check for: index.htm, index.htm.gz,
index.html, index.html.gz, in order.

Fixes the regressions introduced in 9f2cfb8 and 6768116
devyte pushed a commit that referenced this issue Feb 9, 2020
Fixes #6984

When a directory index is requested with an explicit index.html, follow
the original webserver order and check for: index.htm, index.htm.gz,
index.html, index.html.gz, in order.

Fixes the regressions introduced in 9f2cfb8 and 6768116
@JasperHorn
Copy link
Contributor Author

Thanks for picking this up during my radio silence. I was still planning to get back to this, but had since moved on to non-esp projects and didn't get around to this.

Now there's just my other (accepted) pull request which is in need of a follow-up...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants