Skip to content

Conversation

nibra
Copy link
Contributor

@nibra nibra commented Nov 29, 2020

Summary of Changes

Before this change, AbstractGithubObject::fetchUrl() altered the HTTP client on the fly to add header data. Since the header data is not part of the URL, this undocumented side effect is just wrong.
Now, the options are propagated to the client in the constructor, where it should be.

Testing Instructions

See GithubObjectTest::testFetchUrlToken().

Documentation Changes Required

No.

@nibra nibra requested a review from a team November 29, 2020 23:33
// Get a new Uri object focusing the api url and given path.
$uri = new Uri($this->options->get('api.url') . $path);

if ($this->options->get('gh.token', false))

Choose a reason for hiding this comment

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

Will this change not override all other headers that where set by the user.

$this->options['timeout'] = 120;
}

if ($this->options->get('gh.token', false))

Choose a reason for hiding this comment

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

The previous path only set the Authorization if it was not set... now its being set irrespective of that.

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.

2 participants