.....including the mailing list this time :)
On Thu, 16 Dec 2021 at 11:59, Scott van Kalken firstname.lastname@example.org wrote:
I don't know what everyone else would like to do with respect to CORS, but I have found a number of use cases where it would be helpful to be able to set response headers.
Now, there are two things that I can think of here. If this is for an actual application - I should be able to set response headers in my application, so why would I ever need to explicitly do this in unit?
Something like this:
@app.route('/hello', methods=["POST"])def hello(): resp = make_response(render_template('hello.html')) resp.headers['Access-Control-Allow-Origin'] = '*' return resp
If I do that then everything should be fine.
Where this falls down is use case #2 where I want to talk to the unit server itself, or where I have a compiled application and don't necessarily have the source code.
The one that I've been focussed on recently is the "I want to talk to the unit server itself". I've been playing around with visualising the unit configuration, starting with some VUE bits - and also using the tree animation from here: https://philogb.github.io/jit/static/v20/Jit/Examples/Spacetree/example1.htm... (I've been a fan of Nicolas' for some time).
This got me thinking on the wider concepts of CORS headers.
I am still in two minds as to whether unit itself should have this capability or whether there should be an expectation that the application does this.
Open to thoughts on this - because I think it's an interesting area.
On Tue, 14 Dec 2021 at 00:01, Valentin V. Bartenev email@example.com wrote:
On Wednesday, 8 December 2021 03:25:10 MSK Scott van Kalken wrote:
wondering about handling CORS. East to do with NGINX but i’m wondering
the story is with doing this in unit without fronting unit with NGINX.
Is the ability to set headers for CORS available today or is it planned
Unfortunately, there's no way to alter response header fields in Unit yet. Yes, this feature definitely is in our todo.
If you have any idea about how the relevant configuration should look like, please feel free to share.
wbr, Valentin V. Bartenev