Coder Social home page Coder Social logo

Comments (4)

AaronAtDuo avatar AaronAtDuo commented on September 3, 2024

@gkelly Can you confirm you are using Python 3? I can replicate this issue with Python 3.8.5 but not with 2.7.18. On Python 2 I get only one Host header. If possible, could you see if you get the same result for Python 2?

from duo_client_python.

gkelly avatar gkelly commented on September 3, 2024

Yes, I am using Python 3. I just tested this in Python 2.7.14 and did not see the same double-Host-header behavior. However, I also tested #145 in Python 2.7.14 and it does not remove the lone Host header. That is, the request looks correct with the patch applied:

POST /auth/v2/auth HTTP/1.1\r
Host: localhost\r
Accept-Encoding: identity\r
Content-Length: 22\r
Date: Wed, 02 Jun 2021 19:15:49 -0000\r
Content-type: application/x-www-form-urlencoded\r
Authorization: Basic <removed>\r
User-Agent: Duo API Python/4.3.1\r
\r
async=1&factor=testing

from duo_client_python.

AaronAtDuo avatar AaronAtDuo commented on September 3, 2024

I agree. So it seems the Py2 behavior of HTTPConnection is:
"Add a Host header if it's not already there"
Where Py3 is
"Add a Host header"

from duo_client_python.

AaronAtDuo avatar AaronAtDuo commented on September 3, 2024

Merged! We'll try to get a release done ASAP.

Thanks for the contribution and thanks for using Duo.

from duo_client_python.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.