broesamle / rust-playpen

A web interface for running Rust code
MIT License
0 stars 0 forks source link

Send Access-Control-Allow-Origin in http stream #1

Open broesamle opened 7 years ago

broesamle commented 7 years ago

Using hyper::net::HttpListener where to setup the access control headers?

streaming in curl seems to work but browser side fails with

Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at http://127.0.0.1:50123/tenseconds. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing).

broesamle commented 7 years ago

I should mention the relevant branch: https://github.com/broesamle/rust-playpen/tree/streamingchunksB

broesamle commented 7 years ago

as @ioctaptceb found out yesterday, currently, no response headers seem to be written at all for the streaming.

loganmzz commented 7 years ago

Aren't CORS supposed to be sent on an OPTIONS reply done before the blocked one ?

cf. https://developer.mozilla.org/en-US/docs/Web/HTTP/Access_control_CORS