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:
@@ -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
|
||||
|
@@ -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
|
||||
|
Reference in New Issue
Block a user