mami-project / pto3-go

MAMI Path Transparency Observatory server (v3) and associated utilities
1 stars 2 forks source link

OPTIONS preflight request #95

Closed britram closed 6 years ago

schrolf commented 6 years ago

Hi,

In order to handle CORS requests correctly the PTO should also handle preflight requests for these requests which are designed to be called from browser. For references see here: https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Functional_overview https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS#Examples_of_access_control_scenarios

I am mainly speaking of the POST request to '/query/submit' with an API Key. This request is not a 'simple request' (because of the 'Authorization' header), therefore the browser will send a preflight request before sending the actual request.

Rolf