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

Refactoring #53

Open
wants to merge 2 commits into
base: 1.x-dev
Choose a base branch
from
Open

Refactoring #53

wants to merge 2 commits into from

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
@@ -126,18 +131,7 @@ protected function fetchUrl($path, $page = 0, $limit = 0)
// 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.

@@ -103,6 +103,11 @@ public function __construct(Registry $options = null, BaseHttp $client = null)
$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.

None yet

2 participants