c2corg / c2corg/v6_api

Missing CORS headers when write actions are rejected

Open
#720 2 comments 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
26
Forks
28
Avg merge
4h
Merged PRs (30d)
9

Description

See also https://github.com/c2corg/v6_ui/pull/1989#issuecomment-362035223

Tested in prod, demo and in a personal instance:
* if a write action is accepted, nothing special is reported on the UI side in browsers' dev consoles
* on the other hand, if the write action is rejected (blocked or rate limited user, 500 error?), the UI error processing is not performed as expected (https://github.com/c2corg/v6_ui/pull/1989) and CORS errors are reported in the browsers' dev consoles:

![capture du 2018-01-31 20-06-37](https://user-images.githubusercontent.com/1192331/35642480-88507cb0-06c3-11e8-97d3-fd11a2fe9240.png)

It seems CORS headers are not returned when an exception is raised while processing the request.

* failed request (user is blocked):

![capture du 2018-02-01 11-15-59](https://user-images.githubusercontent.com/1192331/35673275-5c079caa-0741-11e8-9142-58e75778bfc7.png)

* successful request:

![capture du 2018-02-01 11-17-35](https://user-images.githubusercontent.com/1192331/35673359-a4eff98a-0741-11e8-85cd-e5a05d6af95b.png)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.