Adds file:// protocol to CORS allowed paths for the sake of Safari on iOS

This commit is contained in:
Tobias Wooldridge 2014-09-12 15:29:01 +09:30 committed by Jeremy Lakeman
parent 6ab2cc5bb6
commit a4e1942d30

View File

@ -358,6 +358,7 @@ int authorize_restful(struct http_request *r)
&& (*remainder==':' || *remainder=='\0'))
|| (strcase_startswith(r->request_header.origin, "http://127.0.0.1", &remainder)
&& (*remainder==':' || *remainder=='\0'))
|| (strcase_startswith(r->request_header.origin, "file://", &remainder))
){
strncpy(r->response.header.allow_origin,r->request_header.origin, sizeof r->response.header.allow_origin);
r->response.header.allow_methods="GET, POST, OPTIONS";