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

Handle invalid JSON on error responses #16

Merged
merged 2 commits into from
Feb 1, 2018
Merged

Conversation

JSkimming
Copy link
Owner

Unauthorized responses state the Content-Type is application/json, but the body is not valid JSON.

Here is an example response.

HTTP/1.1 401 Unauthorized
Server: nginx
Date: Thu, 01 Feb 2018 07:58:39 GMT
Content-Type: application/json
Transfer-Encoding: chunked
Connection: keep-alive
X-Frame-Options: SAMEORIGIN
X-XSS-Protection: 1; mode=block
X-Content-Type-Options: nosniff
Cache-Control: no-store
Pragma: no-cache
WWW-Authenticate: Bearer realm="Doorkeeper", error="invalid_token", error_description="The access token is invalid"
X-Request-Id: b05b4cc2-7684-49bb-b2cc-57c548d4a2cf
X-Runtime: 0.024554

0

@JSkimming JSkimming self-assigned this Feb 1, 2018
@JSkimming JSkimming added the bug label Feb 1, 2018
@codecov
Copy link

codecov bot commented Feb 1, 2018

Codecov Report

Merging #16 into master will not change coverage.
The diff coverage is 100%.

Impacted file tree graph

@@          Coverage Diff          @@
##           master    #16   +/-   ##
=====================================
  Coverage     100%   100%           
=====================================
  Files          14     14           
  Lines         567    571    +4     
  Branches       71     72    +1     
=====================================
+ Hits          567    571    +4
Impacted Files Coverage Δ
src/Tesla.NET/Requests/HttpClientExtensions.cs 100% <100%> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 0abf386...f5f9dfe. Read the comment docs.

@JSkimming JSkimming merged commit 5e82d77 into master Feb 1, 2018
@JSkimming JSkimming deleted the json-read-error branch February 1, 2018 22:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant