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: ask gaxios for text and not json #152

Merged
merged 1 commit into from
Jan 15, 2019
Merged

fix: ask gaxios for text and not json #152

merged 1 commit into from
Jan 15, 2019

Conversation

JustinBeckwith
Copy link
Contributor

I'm not entirely sure why this works today, but I noticed this while making some compatibility fixes in gaxios. I think the intent here was to have json-bigint always do the JSON.parse of the response from the metadata server. If that's the case - we should just ask for text from gaxios, since JSON is the default.

@googlebot googlebot added the cla: yes This human has signed the Contributor License Agreement. label Jan 13, 2019
@@ -59,7 +59,8 @@ async function metadataAccessor<T>(
url: `${BASE_URL}/${type}${property}`,
headers: Object.assign({}, HEADERS, options.headers),
retryConfig: {noResponseRetries},
params: options.params
params: options.params,
responseType: 'text'

This comment was marked as spam.

This comment was marked as spam.

This comment was marked as spam.

Copy link
Contributor

@ofrobots ofrobots left a comment

Choose a reason for hiding this comment

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

Okay, I don't understand how it worked before though. JSON.parse in gaxios of Really Large Numbers should have lost accuracy. It would be worth finding out why that ended up working.

Otherwise, LGTM.

@JustinBeckwith JustinBeckwith merged commit 39be153 into googleapis:master Jan 15, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla: yes This human has signed the Contributor License Agreement.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants