Comments (8)
I was hitting the same problem that @jcomeauictx originally reported: my Authorization header was being mysteriously transformed from Bearer
into Basic
.
I was baffled until I searched for "Basic" in the issues for the requests
project, which turned up this recent bug report: psf/requests#3929
That was indeed my problem. I have this line in my $HOME/.netrc
to enable automatic login for anonymous FTP:
default login anonymous password anonymous@
requests
interprets that to mean it should always override the Authorization header with my .netrc
default, even when the caller has explicitly provided an Authorization header.
According to a comment in that bug report, a requests
core developer is amenable to changing this behavior in requests 3.0 so that when the caller sets Authorization it won't get overridden.
Until then, perhaps python-digitalocean
should consider the advice of requests
core developer @Lukasa:
"So it is quite possible that the library wrapping requests should be setting
trust_env
toFalse
if it is handling headers itself."
Thoughts, @koalalorenzo? Thanks!
from python-digitalocean.
I have requests
version 2.4.3
from python-digitalocean.
requests 2.7.0 no help either.
from python-digitalocean.
If it is a request
problem, maybe we should open an issue there, instead of python-digitalocean
Can you confirm that this is a bug related to request
? I had no time to test it. I will do it probably tomorrow.
from python-digitalocean.
I cannot confirm at this time. but since this bug makes the library unusable, wouldn't you want to know anyway, so you could code around the problem?
from python-digitalocean.
since this bug makes the library unusable, wouldn't you want to know anyway, so you could code around the problem?
OFC. That's why I will check tomorrow ;-) I suggest you to do the same!
I admit that request
in past caused some errors because they changed the way they were using options for specific methods. I will check tomorrow after some sleep! ;-)
from python-digitalocean.
OK thanks.
from python-digitalocean.
It works fine for me, using also requests v 2.4.3
I am going to trigger some automatic tests to be sure that everything is fine.
I was reading your code without understanding what is happening. Are you sure that your code is not messing up with requests? Have you tried on another OS/Machine? So fare it does not seem a problem. If you find the bug, then feel free to re-open the issue 👍
from python-digitalocean.
Related Issues (20)
- Balance support
- NotFoundError is not exposed in 1.15.0
- Load balancer and certificate APIs are returning digitalocean.NotFoundError
- Unable to import module 'Manager' HOT 1
- the API v2 does not seem to provide account name aka team name aka user name. Can advise?
- droplet shutdown is not working HOT 1
- Delete a domain record HOT 4
- Make droplet.create() return a value - so it can be used with 'await' ? HOT 1
- Getting Credits information HOT 1
- No get_actions() for Volume? HOT 1
- Proposing a PR to fix a few small typos
- New release HOT 3
- RedRocket.pssss HOT 1
- Domain.create_new_domain_record ttl kwarg is ignored HOT 1
- Kuberenetes Support HOT 1
- Floating IP Error - digitalocean.DataReadError: HOT 1
- DigitalOcean Api token HOT 2
- Error (400/500) responses with no body raise JSONReadError
- Monitoring metrics from API
- Apps Support
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from python-digitalocean.