Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Cleanup.

  • Loading branch information...
commit 66bdbc3745528d1252a01f4d6292a849c520a07b 1 parent 316e3f4
Jakub Roztočil authored
Showing with 6 additions and 5 deletions.
  1. +3 −3 httpie/client.py
  2. +3 −2 httpie/sessions.py
6 httpie/client.py
View
@@ -52,9 +52,9 @@ def get_requests_kwargs(args):
args.data = json.dumps(args.data) if args.data else None
elif args.form and not args.files:
- # If sending files, `requests` will set
- # the `Content-Type` for us.
- base_headers['Content-Type'] = FORM
+ # If sending files, `requests` will set
+ # the `Content-Type` for us.
+ base_headers['Content-Type'] = FORM
credentials = None
if args.auth:
5 httpie/sessions.py
View
@@ -30,7 +30,7 @@ def get_response(name, request_kwargs, read_only=False):
"""
host = Host(request_kwargs['headers'].get('Host', None)
- or urlparse(request_kwargs['url']).netloc.split('@')[-1])
+ or urlparse(request_kwargs['url']).netloc.split('@')[-1])
session = Session(host, name)
session.load()
@@ -52,7 +52,8 @@ def get_response(name, request_kwargs, read_only=False):
except Exception:
raise
else:
- if not read_only or session.is_new:
+ # Existing sessions with `read_only=True` don't get updated.
+ if session.is_new or not read_only:
session.cookies = rsession.cookies
session.save()
return response
Please sign in to comment.
Something went wrong with that request. Please try again.