Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Add CORS Headers to HTTP error 500 responses #1843

Merged
merged 1 commit into from
Sep 26, 2024
Merged

Conversation

MoritzWeber0
Copy link
Member

Internal server error respones result in no CORS ALLOW_ORIGIN headers added to the response. This leads to wrong handling by the frontend. When there are no CORS headers, status code was 0, which was treated as "Backend not reachable".

There was already handling to add CORS headers, but it didn't add the ALLOW_ORIGIN header, which we add manually now.

Internal server error respones result in no CORS ALLOW_ORIGIN headers
added to the response. This leads to wrong handling by the frontend.
When there are no CORS headers, status code was 0, which was treated as
"Backend not reachable".

There was already handling to add CORS headers, but it didn't add the
ALLOW_ORIGIN header, which we add manually now.
Copy link

sonarcloud bot commented Sep 26, 2024

Copy link

codecov bot commented Sep 26, 2024

Codecov Report

Attention: Patch coverage is 0% with 5 lines in your changes missing coverage. Please review.

Project coverage is 83.96%. Comparing base (5e66986) to head (04af21b).
Report is 2 commits behind head on main.

Files with missing lines Patch % Lines
backend/capellacollab/__main__.py 0.00% 5 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main    #1843      +/-   ##
==========================================
- Coverage   84.01%   83.96%   -0.06%     
==========================================
  Files         194      194              
  Lines        6455     6459       +4     
  Branches      713      714       +1     
==========================================
  Hits         5423     5423              
- Misses        876      880       +4     
  Partials      156      156              

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link

This report was generated by comparing c8d7993 with 5e66986.
If you would like to check difference, please check here.

change detected

ArtifactName: reg

item count
pass 287
change 1
new 0
delete 0
📝 Report

Differences

Model Components_Model Sources_Git_Invalid URL_desktop.png

actual Actual
expected Expected
difference Difference

@MoritzWeber0 MoritzWeber0 merged commit 94fcae6 into main Sep 26, 2024
30 of 31 checks passed
@MoritzWeber0 MoritzWeber0 deleted the fix-cors-error branch September 26, 2024 07:50
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant