pub fn handle_cors(state: &State, res: &mut Response<Body>)
Expand description

Handle CORS for a non-preflight request. This means manipulating the res HTTP headers so that the response is aligned with the state’s CorsConfig.

If you are using the Resource type (which is the recommended way), you’ll never have to call this method. However, if you are writing your own handler method, you might want to call this after your request to add the required CORS headers.

For further information on CORS, read https://developer.mozilla.org/en-US/docs/Web/HTTP/CORS.