if spa/website is running on a different origin, it will have to ask for permission before sending certain requests (POST/PUT/ETC). the client does this by sending pre-flight requests (OPTIONS) to the server.
when the server receives these OPTIONS requests, it determines what should be allowed and attaches headers to the responses
if the appropriate header is set, the client (spa/website) will then be able to perform the request it wanted to (POST/PUT/ETC)