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

Implement HTTP-Authentication for transport methods socket & fopen #7980

Merged
merged 2 commits into from May 25, 2015

Conversation

sgiehl
Copy link
Member

@sgiehl sgiehl commented May 23, 2015

Currently Http-Auth is only possible using curl. Otherwise an exception is raised.

I've implemented Http-Auth for the other transport methods. That is required to let plugin developers update their translations locally if curl is not installed. (The Transifex API requires Http-Auth)

See Thomas--F/BotTracker#20

@sgiehl sgiehl added Needs Review PRs that need a code review Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. and removed Needs Review PRs that need a code review labels May 23, 2015
@sgiehl sgiehl added Needs Review PRs that need a code review and removed Pull Request WIP Indicates the current pull request is still work in progress and not ready yet for a review. labels May 24, 2015
@tsteur
Copy link
Member

tsteur commented May 24, 2015

Is it maybe possible to write tests for it? Not sure if easily doable. If we ever replace Http with a lib it will maybe help us.

@sgiehl
Copy link
Member Author

sgiehl commented May 24, 2015

Hm... I'll have a look

@sgiehl
Copy link
Member Author

sgiehl commented May 24, 2015

I've added some simple tests for checking the response (codes)


// try to get http status code from response headers
if (isset($http_response_header) && preg_match('~^HTTP/(\d\.\d)\s+(\d+)(\s*.*)?~', implode("\n", $http_response_header), $m)) {
$status = (int)$m[2];
Copy link
Member

Choose a reason for hiding this comment

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

Why do we read the HTTP status code?

mattab pushed a commit that referenced this pull request May 25, 2015
Implement HTTP-Authentication for transport methods socket & fopen
@mattab mattab merged commit ca9b73b into master May 25, 2015
@mnapoli mnapoli deleted the http_authentication branch May 25, 2015 10:54
@mattab mattab added the answered For when a question was asked and we referred to forum or answered it. label Oct 5, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
answered For when a question was asked and we referred to forum or answered it. Needs Review PRs that need a code review
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants