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

Initial support for customHeaders #103

Closed
wants to merge 1 commit into from
Closed

Conversation

dayures
Copy link
Contributor

@dayures dayures commented Mar 24, 2018

@wikier @indeyets @iherman , do you agree this approach? (all HTTP headers could be overriden)

Copy link

@iherman iherman left a comment

Choose a reason for hiding this comment

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

@dayures, I have handed over the maintenance of this repository to @wikier a while ago (I have moved to different areas), so my comment may not carry lots of weight. However, having looked at the changes, they seem pretty fine to me and if you do have use cases where such additional custom headers are necessary for a SPARQL endpoint, then I agree these are also necessary.

@@ -349,6 +351,18 @@ def setOnlyConneg(self, onlyConneg):
"""
self.onlyConneg = onlyConneg

def setCustomHeaders(self, customHeaders):
Copy link
Member

Choose a reason for hiding this comment

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

why not also a addCustomHeader(self, header, value) method?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I like the idea. I am going to change the code in order to take this approach!

@@ -704,6 +718,10 @@ def _createRequest(self):
raise NotImplementedError("Expecting one of: {0}, but received: {1}".format(valid_types,
self.http_auth))

# The header field name is capitalized in the request.add_header method.
Copy link
Member

Choose a reason for hiding this comment

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

Do we want to give preference to our internal headers or to the custom ones? Because then the order to request.add_header() matters.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

In this concrete development, the custom ones have more preference than the internal ones (in case somebody want to highly customize the request).

That's why it is warned in the method documentation (line 355)

@wikier
Copy link
Member

wikier commented Mar 25, 2018

I've added few minor comments to the PR. But otherwise it LGTM.

@dayures
Copy link
Contributor Author

dayures commented Apr 5, 2018

Finally, the code was changed slightly (see 66fbbbc), so this PR is not merged.

@dayures dayures closed this Apr 5, 2018
@wikier
Copy link
Member

wikier commented Apr 5, 2018

thx

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

3 participants