Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

Bug fix: Add maxRedirects field to axios requests #4025

Merged
merged 1 commit into from
May 11, 2021

Conversation

eggplantzzz
Copy link
Contributor

A user reported here that they were experiencing issues with making http requests while using Truffle from behind a proxy. It seemed reasonable to assume this had something to do with switching axios in for the deprecated request library (see #3997). After a small amount of investigation I discovered that axios has an option for maxRedirects that defaults to 5. In an attempt to fix this http request issue, this PR increases maxRedirects to 50.

@gnidan
Copy link
Contributor

gnidan commented May 10, 2021

It's kind of ugly that we have to do this everywhere. Is there a clean way to refactor this?

@eggplantzzz
Copy link
Contributor Author

In source fetcher we could make that method that accepts the request object take a couple of parameters that get passed in instead?

@eggplantzzz
Copy link
Contributor Author

There is also a create method on the axios object for passing in defaults. We could use that in source fetcher to only pass in maxRedirects once.

@eggplantzzz eggplantzzz requested a review from gnidan May 11, 2021 15:41
Copy link
Contributor

@gnidan gnidan left a comment

Choose a reason for hiding this comment

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

Good enough for now. Maybe we can figure out a nice way to refactor later

@eggplantzzz eggplantzzz merged commit b1bc561 into develop May 11, 2021
@eggplantzzz eggplantzzz deleted the fix/axios-redirects branch May 11, 2021 16:09
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants