Skip to content
This repository was archived by the owner on Jan 13, 2021. It is now read-only.
Merged
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
Enable override default headers from CLI
  • Loading branch information
pkrolikowski committed Feb 22, 2016
commit 095c50e1e40a5ede448dc3fe75b82bf23edc6768
12 changes: 7 additions & 5 deletions hyper/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -164,12 +164,14 @@ def set_request_data(args):
body, headers, params = {}, {}, {}
for i in args.items:
if i.sep == SEP_HEADERS:
# :key:value case
if i.key == '':
k, v = i.value.split(':')
headers[':' + k] = v
else:
if i.key:
headers[i.key] = i.value
else:
# when overriding a HTTP/2 special header there will be a leading
# colon, which tricks the command line parser into thinking
# the header is empty

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Mind indenting this one more level?

k, v = i.value.split(':', 1)
headers[':' + k] = v
elif i.sep == SEP_QUERY:
params[i.key] = i.value
elif i.sep == SEP_DATA:
Expand Down