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

Wrap StarletteRequestExtractor in capture_internal_exceptions #1551

Merged
merged 1 commit into from Aug 8, 2022

Conversation

sl0thentr0py
Copy link
Member

@sl0thentr0py sl0thentr0py commented Aug 8, 2022

Fixes #1550

If the header type is not consistent with the body, the SDK currently throws internally.

before

(venv) ➜  fastapi git:(main) ✗ curl -X 'POST' \
  'http://localhost:8000/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d 'grant_type=&username=johndoe&password=secret&scope=&client_id=&client_secret='
Internal Server Error

after

(venv) ➜  fastapi git:(main) ✗ curl -X 'POST' \
  'http://localhost:8000/token' \
  -H 'accept: application/json' \
  -H 'Content-Type: application/json' \
  -d 'grant_type=&username=johndoe&password=secret&scope=&client_id=&client_secret='
{"detail":[{"loc":["body","username"],"msg":"field required","type":"value_error.missing"},{"loc":["body","password"],"msg":"field required","type":"value_error.missing"}]}%

@sl0thentr0py sl0thentr0py marked this pull request as ready for review August 8, 2022 11:50
@sl0thentr0py sl0thentr0py merged commit 89c800b into master Aug 8, 2022
@sl0thentr0py sl0thentr0py deleted the neel/safe-extract-info-fastapi branch August 8, 2022 12:23
@mdczaplicki
Copy link

Hey, any ETA for new patch version?

@vladanpaunovic
Copy link
Contributor

@mdczaplicki, we submitted a release, you can follow it up here getsentry/publish#1283

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.

JSONDecodeError Expecting value: line 1 column 1 (char 0) (StarletteIntegration)
3 participants