When using http_request
to serve content it occurred to me that when i try to set the access-control-allow-origin
through the headers it can’t be changed and always default to *
.
i tried changing;
- changing order
- upper- / lowercase
- changing the value
Other headers are set as expected;
let headers = vec![
HeaderField("content-type".to_string(), "image/png".to_string()),
HeaderField("accept-ranges".to_string(), "bytes".to_string()),
HeaderField("content-length".to_string(), size.to_string()),
HeaderField("david".to_string(), "does_it_work".to_string()),
HeaderField("access-control-allow-origin".to_string(), format!("https://{}.raw.ic0.app", id().to_string())),
];
What can cause this? and how can i fix it?