Skip to content
This repository was archived by the owner on Mar 18, 2019. It is now read-only.

Fix handling of deprecated credentials in HTTPTransport #146

Open
wants to merge 3 commits into
base: master
Choose a base branch
from
Open
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
HTTPTransport: ignore credentials if auth is given
  • Loading branch information
blueyed committed Sep 12, 2017
commit d0f9d041722c462520848fe98bc1e5b1854ecbd4
13 changes: 8 additions & 5 deletions coreapi/transports/http.py
Original file line number Diff line number Diff line change
Expand Up @@ -345,11 +345,14 @@ def __init__(self, credentials=None, headers=None, auth=None, session=None, requ
session.cookies.set_policy(BlockAll())

if credentials is not None:
warnings.warn(
"The 'credentials' argument is now deprecated in favor of 'auth'.",
DeprecationWarning
)
session.auth = DomainCredentials(credentials)
if auth is not None:
warnings.warn("Ignoring 'credentials' argument in favor of 'auth'.")
else:
warnings.warn(
"The 'credentials' argument is now deprecated in favor of 'auth'.",
DeprecationWarning
)
session.auth = DomainCredentials(credentials)
if request_callback is not None or response_callback is not None:
warnings.warn(
"The 'request_callback' and 'response_callback' arguments are now deprecated. "
Expand Down
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy