-
Notifications
You must be signed in to change notification settings - Fork 98
CORS protection fires up with AJAX #27
Comments
This enhancement is good, and will be definitely included in next release soon. Can you write an small example to demonstrate this new feature or with some note about how/when to use it for other users / use cases. I don't think there is some security problem for this enhancement as the CP is on just for a very short time and there is nothing to worry. What's your thoughts on this? Regards, |
The thing is I cant decide if it is enhancment or is it a bug to repair a bug :) so Use case: Hope it roughly covers the problem/solution :) |
### Releases 1.0.11 1. Add optional **CORS (Cross-Origin Resource Sharing)** feature. Thanks to [AlesSt](https://github.com/AlesSt). See more in [Issue #27: CORS protection fires up with AJAX](#27) and [Cross Origin Resource Sharing](https://en.wikipedia.org/wiki/Cross-origin_resource_sharing). To use, you must explicitly use `#define USING_CORS_FEATURE true` 2. Solve issue softAP with custom IP sometimes not working. Thanks to [AlesSt](https://github.com/AlesSt). See [Issue #26: softAP with custom IP not working](#26) and [Wifi.softAPConfig() sometimes set the wrong IP address](espressif/arduino-esp32#985). 3. Temporary fix for issue of not clearing WiFi SSID/PW from flash of ESP32. Thanks to [AlesSt](https://github.com/AlesSt). See more in [Issue #25: API call /r doesnt clear credentials](#25) and [WiFi.disconnect(true) problem](espressif/arduino-esp32#400). 4. Fix autoConnect() feature to permit autoConnect() to use STA static IP or DHCP IP. Remove from deprecated functi0n list. 5. Enhance README.md with more instructions and illustrations.
Hi @AlesSt Just inform you that the new ESP_WiFiManager v1.0.11 has been released, certainly with your contribution well noted in Contributions-and-Thanks as well as in library source files. Releases 1.0.11
|
It is I Leclerc (if you ever watched nowadays prehistoric episodes of ALO ALO :)
So what I did is I commented out all Portal pages but API calls:
so in my code i just do a
#define NO_WWW
and I use my version or omit it and use your version (man i ll use some nasty words when i ll forget about it and just update ur lib - i guess i ll need to get WAAAAY more familiar with git but just clone :)my code in ESP32 fires up ConfPortal from WM after it receives msg from MQTT
after that i got my friend to make me an app for android to set all my ESP32s for my home automation.
so there i choose MAC address of ESP and I send MQTT to start CP and the android app sends /sc so i get in my phone all WiFis available to ESP but there was a problem because in the request header Origin and Host part arent the same HENCE CORS protection fires up in remote device (phone or computer - any browser).
I did some digging and found out that ANY response from the server needs to have
sendHeader("Access-Control-Allow-Origin", "*")
in the response header.###########WARNING##########
this solution IS NOT for regular web servers as this one is on for a minute or so and shuts down - also not available on internet
this warning is for any person finding this POST related to CORS error (and trying to solve apache or any other server on internet !!!!!!!!!!!!
########END OF WARNING#######
so I added another line to the library with handleScan function to solve the problem
I hope things i mentioned comes in hand with preping next update :)
The text was updated successfully, but these errors were encountered: