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

Delete incoming connection headers, #85

Closed
wants to merge 5 commits into from

Conversation

btsimonh
Copy link

Delete incoming connection headers,
change rlist.clear() to del rlist[;] for python 2.7 comparability
hide log of authorization header.

fixes #71 for me for NEGOCIATE and NTLM

please examine carefully, as I'm no python expert and no HTTP/Proxy expert.

Thankyou for a nice implementation - this is the only thing I found for this purpose :).

change rlist.clear() to del rlist[;] for python 2.7 compatability
hide log of authorization header
@btsimonh
Copy link
Author

don't merge yet. Seems it keeps connections open too long now. back to square one.

@btsimonh
Copy link
Author

ok, all done now.

h_connection = self.headers["Connection"]
del self.headers["Connection"]
dprint("removed 'Connection'")

Copy link
Owner

Choose a reason for hiding this comment

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

Is this really required for do_CONNECT to work or can we limit the change to auth only?

@btsimonh
Copy link
Author

I thought that I read that connection: headers were not relevant for CONNECT, so they should not be there. So decided belt and braces to delete one if found, and no point in storing it for later.
Any 'connection: close' would be inside the connection, and so private and hidden from the CONNECT request....

rlist.clear()
# rlist.clear() - stick with 2.7 compatible list operator.
del rlist[:]

Copy link
Owner

Choose a reason for hiding this comment

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

Why is this better?

Copy link
Author

Choose a reason for hiding this comment

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

.clear() is not available in python 2.7(?) -> error.
del rlist[:] does the same according to google? - but I am no python guru :).
(I happened to have 2.x installed for other reasons; so saw the error. But soon installed 3.x for it's advantages. - but then had to reinstate 2.x for the 'other reasons' not working with 3.x -> now have both but need to swap between them.)

genotrance added a commit that referenced this pull request May 20, 2019
@genotrance
Copy link
Owner

I have merged almost all your changes from this PR in 3bae3f8. Thank you for the fixes and please test and verify that it works as expected.

@genotrance genotrance closed this May 20, 2019
@btsimonh
Copy link
Author

yes, it works as well as my version for my uses - tested against WinGate (paa....). thankyou!

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.

Negotiate auth not working
2 participants