May 21, 2014
11:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
May 21, 2014
11:47 AM
I added the
"Access-Control-Allow-Origin: *\r\n" // This line added to enable cross site scripting
line in the top of the http_server.c in Library/deamons. It allows me to build my web site as files on my PC and go against real JSON data from my device. Thought it might be handy to others. Let me know if there is a better approach to adding CORS support.
<snip>
static const char ok_header[] =
"HTTP/1.0 200 OK\r\n"
"Access-Control-Allow-Origin: *\r\n" // This line added to enable cross site scripting
"Content-Type: ";
</snip>
Labels
- Labels:
-
SPI
1 Reply