Skip to content

Commit

Permalink
handleFile send_P
Browse files Browse the repository at this point in the history
  • Loading branch information
dontsovcmc committed Sep 17, 2023
1 parent dac72a6 commit 2a7a19f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 8 deletions.
10 changes: 4 additions & 6 deletions WiFiManager.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -689,8 +689,7 @@ void WiFiManager::setupHTTPServer(){
server->on(WM_G(R_erase), std::bind(&WiFiManager::handleErase, this, false));
server->on(WM_G(R_status), std::bind(&WiFiManager::handleWiFiStatus, this));

server->on(WM_G(R_style_min_css),std::bind(&WiFiManager::handleFile, this, HTTP_TEXT_CSS, style_min_css));

server->on(WM_G(R_style_min_css),std::bind(&WiFiManager::handleFile, this, WM_G(HTTP_TEXT_CSS), style_min_css));

server->onNotFound (std::bind(&WiFiManager::handleNotFound, this));

Expand Down Expand Up @@ -1447,15 +1446,14 @@ void WiFiManager::handleWifi(boolean scan) {
#endif
}

void WiFiManager::handleFile(const char* progmem_file_type,
const char* progmem_string)
void WiFiManager::handleFile(const char *progmem_file_type,
PGM_P progmem_string)
{
#ifdef WM_DEBUG_LEVEL
DEBUG_WM(DEBUG_VERBOSE,F("<- HTTP File"));
#endif
handleRequest();
String content(FPSTR(progmem_string));
server->send(200, FPSTR(progmem_file_type), content);
server->send_P(200, progmem_file_type, progmem_string);
}

/**
Expand Down
4 changes: 2 additions & 2 deletions WiFiManager.h
Original file line number Diff line number Diff line change
Expand Up @@ -655,8 +655,8 @@ class WiFiManager
void handleNotFound();
void handleExit();
void handleClose();
void handleFile(const char* progmem_file_type,
const char* progmem_string);
void handleFile(const char * progmem_file_type,
PGM_P progmem_string);

// void handleErase();
void handleErase(boolean opt);
Expand Down

0 comments on commit 2a7a19f

Please sign in to comment.