Browse Source

Configure WEB_REMOTE_DOMAIN at runtime (#1789)

* Configure WEB_REMOTE_DOMAIN at runtime

* typo
master
Max Prokhorov 5 years ago
committed by GitHub
parent
commit
36f6c822ad
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 3 deletions
  1. +4
    -3
      code/espurna/ws.ino

+ 4
- 3
code/espurna/ws.ino View File

@ -543,10 +543,11 @@ void wsSetup() {
webServer()->addHandler(&_ws);
// CORS
#ifdef WEB_REMOTE_DOMAIN
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", WEB_REMOTE_DOMAIN);
const String webDomain = getSetting("webDomain", WEB_REMOTE_DOMAIN);
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Origin", webDomain);
if (!webDomain.equals("*")) {
DefaultHeaders::Instance().addHeader("Access-Control-Allow-Credentials", "true");
#endif
}
webServer()->on("/auth", HTTP_GET, _onAuth);


Loading…
Cancel
Save