Only return CORS headers in the response as required
authorDerk-Jan Hartman <hartman.wiki@gmail.com>
Thu, 4 Dec 2014 14:39:50 +0000 (15:39 +0100)
committerDerk-Jan Hartman <hartman.wiki@gmail.com>
Wed, 31 Dec 2014 17:40:59 +0000 (18:40 +0100)
commit3eacf0349fe7ff6f2c831831501037c92a2185c6
treeda2563ba8792e4db5dede488bfaca65ecfd8438a
parent61e23c05780c1371ee54e0c5975fc5e28fab6974
Only return CORS headers in the response as required

- Split out responses of preflight and actual CORS requests
- If the request is not CORS valid, don't set the CORS response headers

Note that invalid CORS requests should not actually throw error
responses, the client should simply not handle the response because the
response does not have the right headers (it's a client side policy
error not an http error). We do throw a 403 for a mismatch with the
queryparam, but since that is 'outside' of the spec, that might be
appropriate.

Bug: T76701
Change-Id: Ib296c68babe5c0b380268ee7793b3d6d35b9c3e3
includes/api/ApiMain.php