-
Notifications
You must be signed in to change notification settings - Fork 48
Use Session for making requests & allow customization #44
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
Use Session for making requests & allow customization #44
Conversation
|
I see PR status is |
|
Hi! I haven't tested this yet, and haven't checked if something else needs changing. |
49b15e9 to
22ebf4b
Compare
|
@mingchen I tested this together with django-cas-ng/django-cas-ng#298 and it works for my purposes. Does this look good to you? I'll want to add a test case as well before I consider this ready. Looks like there's nothing in documentation that needs changing? There are some behavioral differences affecting users of python-cas, since all requests now go through the
I doubt this causes any breakage for users, but that's famous last words. :) |
|
Looks good to me. reuse session should not break anything beside improve performance if keep-alive is supported by server. |
22ebf4b to
fbf6808
Compare
9b153c8 to
0a93483
Compare
|
@mingchen OK, I added a test case and rephrased the PR/commit description. Should be ready now. |
All requests made by python-cas now use a Session object, which enables keep-alive HTTP connections. The session can also be customized by passing a `session=` argument to `CASClient` constructors, to change behaviors such as HTTP headers, proxies, hooks and more. My use case requires making all CAS requests through an HTTP proxy.
0a93483 to
8ac88fe
Compare
|
Released 1.6.0 |
|
Awesome! Thanks for responding so quickly and also for your continued maintenance of these projects. |
…s Session @intgr Added a CAS_SESSION_FACTORY setting (must be a callable), which allows customizing many requests behaviors such as HTTP headers, proxies, hooks and more. An example use case requires making all CAS requests through an HTTP proxy. This depends upon the python-cas PR at python-cas/python-cas#44
All requests made by python-cas now use a Session object, which enables keep-alive HTTP connections.
The session can also be customized by passing a
session=argument toCASClientconstructors, to change behaviors such as HTTP headers, proxies, hooks and more.My use case requires making all CAS requests through an HTTP proxy.