vitotai / BrewManiacEsp8266

BrewManiac on ESP8266. Only ESP8266 needed.
155 stars 71 forks source link

Returning no body to a XMLhttprequest call results in error in Firefox #19

Closed allthepies closed 6 years ago

allthepies commented 6 years ago

https://github.com/vitotai/BrewManiacEsp8266/blob/50f790a6c3d7ea5c382f8b1879329ebfbc2ed994/src/BrewManiacEx.cpp#L537

Returning no body causes a client side JS error in Firefox (new version) as it doesn't like empty responses.

XML Parsing Error: no element found Location: http://192.168.0.14/button.php?code=4 Line Number 1, Column 1:

No error reported in Chrome. The error doesn't stop the panel buttons (in this case) from working but no errors are good right! :+1:

Returning an empty JSON structure fixes the problem. request->send(200, "text/json", "{}")

vitotai commented 6 years ago

will do.

allthepies commented 6 years ago

I see you've changed a different line :)
Same principle applies I guess. My report was about the response to the /button.php GET

Line 537 request->send(200);

vitotai commented 6 years ago

done. Sorry about that.

allthepies commented 6 years ago

No more Firefox errors, thanks.