-
Notifications
You must be signed in to change notification settings - Fork 13.3k
ESP8266WebServerSecure.serveStatic() and BearSSL failed with "ERR_CONTENT_LENGTH_MISMATCH" #4908
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
Closed
6 tasks done
Labels
Comments
Good debugging! Ah, the joys of templates and non-virtual functions combined with Arduino's love of passing copies of objects instead of references. At first glance your description looks good and there's probably not a simple way to make it work (can't do virtual templates in C++), but we can figure something out. |
earlephilhower
added a commit
to earlephilhower/Arduino
that referenced
this issue
Apr 12, 2019
Supercedes esp8266#4912 Refactor the three versions of ESP8266WebServer and *WebServerSecure to a single templated class. Use "using" to enable old, non-templated names to b used (so no user changes required to compile or run). Fixes esp8266#4908 and clean up the code base a lot. Basic tests run (the ones in the example code). No code changes are required in userland except for setting the SSL certificates which now use a cleaner "getServer()" accessor and lets the app use the native BearSSL calls on the WiFiClientSecure object. @devyte should be proud, it removes virtuals and even has template specialization...
d-a-v
pushed a commit
that referenced
this issue
Jul 4, 2019
* Convert ESP8266WebServer* into templatized model Supercedes #4912 Refactor the three versions of ESP8266WebServer and *WebServerSecure to a single templated class. Use "using" to enable old, non-templated names to b used (so no user changes required to compile or run). Fixes #4908 and clean up the code base a lot. Basic tests run (the ones in the example code). No code changes are required in userland except for setting the SSL certificates which now use a cleaner "getServer()" accessor and lets the app use the native BearSSL calls on the WiFiClientSecure object. @devyte should be proud, it removes virtuals and even has template specialization... * Fix HTTPUpdate templates and examples * Fix HTTPUpdateServer library build Need to remove dot-a linkage since there are no .cpp files in the directory anymore due to templates. * Provide backward-compat names for updt template Allow existing code to use the same well known names for HTTPUpdateSecure. * Remove ClientType from all templates, auto-infer Remove the ClientType template parameter from all objects. Simplifies the code and makes it more foolproof. Add a "using" in each server to define the type of connection returned by all servers, which is then used in the above templates automatically. * Can safely include FS.h now that SD/SPIFFS unified * Move the templates/objects to their own namespaces * Fix merge issues with untemplated methods * Address review comments * Fix mock test, remove warnings inside test dir Make the simple mock test CI job pass and clean up any spurious warnings in the test directory. There still are warnings in the libraries and core, but they should be addressed in a separate PR.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Basic Infos
Platform
Settings in IDE
Problem Description
When using .serveStatic () I always get the error message in the browser "ERR_CONTENT_LENGTH_MISMATCH"
If I use the server.on () function, the file will be sent correctly.
I tried to find the cause
ESP8266WebServer.cpp
RequestHandlersImpl.h
it is called
ESP8266WebServer.h
instead of
ESP8266WebServerSecure.h
The pointer * this should be refer to BearSSL::ESP8266WebServerSecure server (443)?
I think that's it but I do not know how to fix it.
MCVE Sketch
Debug Messages
The text was updated successfully, but these errors were encountered: