-
Notifications
You must be signed in to change notification settings - Fork 245
Description
What happened
I ran rustup doc --book to open the book from my local copy of the docs. I went to .rustup/toolchains/stable-x86_64-apple-darwin/share/doc/rust/html/book/second-edition/ch01-02-hello-world.html and clicked the play button for the first example under the "Writing and Running a Rust Program" header, which contains:
fn main() {
println!("Hello, world!");
}
The UI just shows "Running..." and never shows results or an error message.
Inspecting the network tab shows an OPTIONS request to https://play.rust-lang.org/evaluate.json returned 400 Bad Request. The request headers are as follows:
OPTIONS /evaluate.json HTTP/1.1
Host: play.rust-lang.org
User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.12; rv:57.0) Gecko/20100101 Firefox/57.0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: null
Connection: keep-alive
Requests from file:/// for local docs have null for the Origin, and the playground has its CORS set not to allow these kinds of requests.
Are there any negative consequences to allowing these requests via CORS?