]> git.bitcoin.ninja Git - dnssec-prover/commitdiff
Include an octet-stream header/CORS headers in proof responses
authorMatt Corallo <git@bluematt.me>
Thu, 8 Feb 2024 05:35:03 +0000 (05:35 +0000)
committerMatt Corallo <git@bluematt.me>
Thu, 8 Feb 2024 05:37:28 +0000 (05:37 +0000)
src/http.rs

index f344372e4d72ca1993b237470f4a4b23fc32c514..5312bbba06b43aac42588653f4827aa43fba2927 100644 (file)
@@ -122,13 +122,13 @@ mod imp {
                                        };
 
                                        let _ = socket.write_all(
-                                               format!("HTTP/1.1 200 OK\r\nContent-Length: {}\r\n\r\n", proof.len()).as_bytes()
+                                               format!("HTTP/1.1 200 OK\r\nContent-Length: {}\r\nContent-Type: application/octet-stream\r\nAccess-Control-Allow-Origin: *\r\n\r\n", proof.len()).as_bytes()
                                        ).await;
                                        let _ = socket.write_all(&proof).await;
                                        return;
                                }
                                let _ = socket.write_all(format!(
-                                       "HTTP/1.1 {}\r\nContent-Length: {}\r\nContent-Type: text/plain\r\n\r\n{}",
+                                       "HTTP/1.1 {}\r\nContent-Length: {}\r\nContent-Type: text/plain\r\nAccess-Control-Allow-Origin: *\r\n\r\n{}",
                                        response.0, response.1.len(), response.1,
                                ).as_bytes()).await;
                        });