Verified Commit 7200d673 authored by Vasili Novikov's avatar Vasili Novikov
Browse files

Document "insecure http headers" override

parent 74007e76
Showing with 4 additions and 1 deletion
+4 -1
......@@ -58,6 +58,9 @@ Run:
RUST_LOG=pod=debug,info cargo run
```
To set `Access-Control-Allow-Origin` HTTP header to `*`,
the the environment variable `INSECURE_HTTP_HEADERS` to any value.
You can read about various components of the server:
* Memri project: [blog.memri.io](https://blog.memri.io/)
......
......@@ -15,7 +15,7 @@ pub async fn run_server(sqlite_pool: Pool<SqliteConnectionManager>) {
info!("Starting {} HTTP server", package_name);
let mut headers = HeaderMap::new();
if std::env::var_os("INSECURE_ACCESS").is_some() {
if std::env::var_os("INSECURE_HTTP_HEADERS").is_some() {
info!("Adding Access-Control-Allow-Origin header as per environment config");
headers.insert("Access-Control-Allow-Origin", HeaderValue::from_static("*"));
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment