-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Templatized ESP8266WebServer can't inherit StaticRequestHandler #7600
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
Comments
did you try
|
OK Now I feel like an idiot, 20+ years of programming and I didn't think to check the namespaces :-( Thank you |
Looks like this is all taken care of, then. Closing. If it's not, then do let us know! |
@jason-but if you knew about #7560 or if it were merged, you would have found by yourself :) |
Unfortunately, I don't solely work in this area/space so I don't follow changes religiously, otherwise I would have :-) Hence why I only recently started porting the old code To make me look even more stupid, I've been programming since 83, and C++ programming since 92, so nearly 30 years and the namespace thing didn't occur to me |
Basic Infos
Platform
Settings in IDE
Problem Description
Recently porting some old code I wrote that utilised version 2.5.x of the ESP8266 libraries, ESP8266WebServer and StaticRequestHandler. Upgrading to a version of 2.6 or later has ESP8266WebServer moving to a templatized implementation. The mechanism I deployed which functioned correctly to statically serve web pages on the FS with authentication no longer compiles
In my original code, I inherited StaticRequestHandler as
This allowed me to extend StaticRequestHandler to call an user-provided authentication function to do basic HTTP auth prior to allowing access to the page.
I installed the page as per:
This would then successfully serve all files in the /web directory but only if _auth_func() returned true that the browser was successfully authenticated. The _auth_func() function would call _cServer.authenticate() and/or _cServer.requestAuthentication() as required
After upgrading to the templatized library, I tried to rewrite this as a templatized class
Debug Messages
This now fails to compile with the following error messages
I similarly cannot create an instance of even the basic StaticRequestHandler<> from my own code.
The templatisation has hidden the RequestHandler<> class and all inherited classes and they are no longer useable
Can this be fixed, or is there a better way to serve Static Web pages while also running HTTP basic authentication?
The text was updated successfully, but these errors were encountered: