1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-08-26 01:44:17 +03:00

Avoid #includes with a surrounding namespace (#7560)

untangle the namespace/double inclusions in webserver library.
This is a followup of the discussion in
https://github.com/esp8266/Arduino/pull/6946#discussion_r361582525
This commit is contained in:
Dirk Mueller
2020-09-17 15:35:27 +02:00
committed by GitHub
parent e5c84c9503
commit 32470fbfab
5 changed files with 20 additions and 4 deletions

View File

@@ -5,6 +5,8 @@
#include <vector>
#include <assert.h>
namespace esp8266webserver {
template<typename ServerType>
class RequestHandler {
using WebServerType = ESP8266WebServerTemplate<ServerType>;
@@ -31,4 +33,6 @@ public:
}
};
} // namespace
#endif //REQUESTHANDLER_H

View File

@@ -7,7 +7,7 @@
#include "WString.h"
#include "Uri.h"
using namespace mime;
namespace esp8266webserver {
template<typename ServerType>
class FunctionRequestHandler : public RequestHandler<ServerType> {
@@ -126,6 +126,7 @@ public:
String contentType = mime::getContentType(path);
using namespace mime;
// look for gz file, only if the original specified path is not a gz. So part only works to send gzip via content encoding when a non compressed is asked for
// if you point the the path to gzip you will serve the gzip as content type "application/x-gzip", not text or javascript etc...
if (!path.endsWith(FPSTR(mimeTable[gz].endsWith)) && !_fs.exists(path)) {
@@ -164,5 +165,6 @@ protected:
size_t _baseUriLength;
};
} // namespace
#endif //REQUESTHANDLERSIMPL_H