Skip to content

Commit

Permalink
Merge pull request #5 from scott113341/20220314/add-cors-header
Browse files Browse the repository at this point in the history
Add permissive CORS header to HTTP server
  • Loading branch information
dfyz authored Mar 15, 2022
2 parents d8b6000 + d1e1311 commit 2045375
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions src/http_server.rs
Original file line number Diff line number Diff line change
Expand Up @@ -186,6 +186,7 @@ fn serve_data(stream: &mut TcpStream, data: &[u8], content_type: &str) {
"HTTP/1.1 200 OK",
&format!("Content-Type: {}", content_type),
&format!("Content-Length: {}", data.len()),
"Access-Control-Allow-Origin: *",
"Connection: close",
"",
"",
Expand Down

0 comments on commit 2045375

Please sign in to comment.