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

Remove headers from Request of http.parseJSON returned error #199

Merged
merged 1 commit into from
Feb 3, 2021

Conversation

brandon-welsch
Copy link
Member

@brandon-welsch brandon-welsch commented Feb 3, 2021

GRR-94

This pollutes the log, does not give more information for debug, and leaks the JWT token 👎🏻

Example of log:

fail to parse JSON of subresource response: fail to parse JSON of request &{GET https://api.scalingo.com/v1/apps/test? HTTP/1.1 1 1 map[Accept:[application/json] Authorization:[Bearer ...] Content-Type:[application/json] User-Agent:[Scalingo Go Client]] <nil> <nil> 0 [] false api.scalingo.com map[] map[] <nil> map[] <nil> <nil> <nil> 0xc0001f3200}, json: cannot unmarshal string into Go value of type scalingo.App

@brandon-welsch brandon-welsch force-pushed the fix/GRR-94/remove-request-from-error branch from 6fcb8fd to c2789be Compare February 3, 2021 17:13
@brandon-welsch brandon-welsch requested a review from Soulou February 3, 2021 17:13
Copy link
Member

@Soulou Soulou left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I disagree with this patch, we want some metadata like the URL path, but not the headers

@brandon-welsch brandon-welsch changed the title Remove request from http.parseJSON returned error Remove headers from Request of http.parseJSON returned error Feb 3, 2021
@brandon-welsch brandon-welsch force-pushed the fix/GRR-94/remove-request-from-error branch 3 times, most recently from 65ba375 to 7e293da Compare February 3, 2021 17:25
@Soulou
Copy link
Member

Soulou commented Feb 3, 2021

The current state would display:

fail to parse JSON of subresource response: fail to parse JSON of request &{GET https://api.scalingo.com/v1/apps/test? HTTP/1.1 1 1 map[Accept:[application/json] Authorization:[Bearer ...] Content-Type:[application/json] User-Agent:[Scalingo Go Client]] <nil> <nil> 0 [] false api.scalingo.com map[] map[] <nil> map[] <nil> <nil> <nil> 0xc0001f3200}, json: cannot unmarshal string into Go value of type scalingo.App

Could you change to display

fail to parse JSON of subresource response: fail to parse JSON of request GET https://api.scalingo.com/v1/apps/test?, json: cannot unmarshal string into Go value of type scalingo.App

?

@brandon-welsch brandon-welsch force-pushed the fix/GRR-94/remove-request-from-error branch from 7e293da to 582bd4b Compare February 3, 2021 17:31
@brandon-welsch brandon-welsch requested a review from Soulou February 3, 2021 17:32
@Soulou Soulou merged commit 0742303 into master Feb 3, 2021
@Soulou Soulou deleted the fix/GRR-94/remove-request-from-error branch February 3, 2021 17:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants