You've already forked httpie-cli
mirror of
https://github.com/httpie/cli.git
synced 2025-08-10 22:42:05 +02:00
Implement support for multiple headers with the same name in sessions (#1335)
* Properly remove duplicate Cookie headers * Implement support for multiple headers with the same name in sessions * More testing * Cleanup * Remove duplicated test, cleanup * Fix pycodestyle * CHANGELOG Co-authored-by: Jakub Roztocil <jakub@roztocil.co>
This commit is contained in:
@@ -27,5 +27,5 @@
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
@@ -27,5 +27,5 @@
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
@@ -26,8 +26,14 @@
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"headers": {
|
||||
"X-Data": "value",
|
||||
"X-Foo": "bar"
|
||||
}
|
||||
"headers": [
|
||||
{
|
||||
"name": "X-Data",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "X-Foo",
|
||||
"value": "bar"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -10,5 +10,5 @@
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
@@ -10,5 +10,5 @@
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
14
tests/fixtures/session_data/new/empty_headers_dict.json
vendored
Normal file
14
tests/fixtures/session_data/new/empty_headers_dict.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "__version__"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": []
|
||||
}
|
14
tests/fixtures/session_data/new/empty_headers_list.json
vendored
Normal file
14
tests/fixtures/session_data/new/empty_headers_list.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "__version__"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": []
|
||||
}
|
40
tests/fixtures/session_data/new/headers_cookies_dict_mixed.json
vendored
Normal file
40
tests/fixtures/session_data/new/headers_cookies_dict_mixed.json
vendored
Normal file
@@ -0,0 +1,40 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "__version__"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [
|
||||
{
|
||||
"domain": __host__,
|
||||
"expires": null,
|
||||
"name": "baz",
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "quux"
|
||||
},
|
||||
{
|
||||
"domain": __host__,
|
||||
"expires": null,
|
||||
"name": "foo",
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"headers": [
|
||||
{
|
||||
"name": "X-Data",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "X-Foo",
|
||||
"value": "bar"
|
||||
}
|
||||
]
|
||||
}
|
23
tests/fixtures/session_data/new/headers_dict.json
vendored
Normal file
23
tests/fixtures/session_data/new/headers_dict.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "__version__"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": [
|
||||
{
|
||||
"name": "foo",
|
||||
"value": "bar"
|
||||
},
|
||||
{
|
||||
"name": "baz",
|
||||
"value": "quux"
|
||||
}
|
||||
]
|
||||
}
|
39
tests/fixtures/session_data/new/headers_dict_extras.json
vendored
Normal file
39
tests/fixtures/session_data/new/headers_dict_extras.json
vendored
Normal file
@@ -0,0 +1,39 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "__version__"
|
||||
},
|
||||
"auth": {
|
||||
"raw_auth": "foo:bar",
|
||||
"type": "basic"
|
||||
},
|
||||
"cookies": [
|
||||
{
|
||||
"domain": null,
|
||||
"expires": null,
|
||||
"name": "baz",
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "quux"
|
||||
},
|
||||
{
|
||||
"domain": null,
|
||||
"expires": null,
|
||||
"name": "foo",
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"headers": [
|
||||
{
|
||||
"name": "X-Data",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "X-Foo",
|
||||
"value": "bar"
|
||||
}
|
||||
]
|
||||
}
|
23
tests/fixtures/session_data/new/headers_list.json
vendored
Normal file
23
tests/fixtures/session_data/new/headers_list.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.2.0"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": [
|
||||
{
|
||||
"name": "X-Data",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "X-Foo",
|
||||
"value": "bar"
|
||||
}
|
||||
]
|
||||
}
|
@@ -23,5 +23,5 @@
|
||||
"value": "bar"
|
||||
}
|
||||
},
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
@@ -23,5 +23,5 @@
|
||||
"value": "bar"
|
||||
}
|
||||
},
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
@@ -22,8 +22,14 @@
|
||||
"value": "bar"
|
||||
}
|
||||
},
|
||||
"headers": {
|
||||
"X-Data": "value",
|
||||
"X-Foo": "bar"
|
||||
}
|
||||
"headers": [
|
||||
{
|
||||
"name": "X-Data",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "X-Foo",
|
||||
"value": "bar"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
@@ -10,5 +10,5 @@
|
||||
"username": null
|
||||
},
|
||||
"cookies": {},
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
@@ -10,5 +10,5 @@
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": {}
|
||||
"headers": []
|
||||
}
|
||||
|
14
tests/fixtures/session_data/old/empty_headers_dict.json
vendored
Normal file
14
tests/fixtures/session_data/old/empty_headers_dict.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.0.2"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": {}
|
||||
}
|
14
tests/fixtures/session_data/old/empty_headers_list.json
vendored
Normal file
14
tests/fixtures/session_data/old/empty_headers_list.json
vendored
Normal file
@@ -0,0 +1,14 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.0.2"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": []
|
||||
}
|
30
tests/fixtures/session_data/old/headers_cookies_dict_mixed.json
vendored
Normal file
30
tests/fixtures/session_data/old/headers_cookies_dict_mixed.json
vendored
Normal file
@@ -0,0 +1,30 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.0.2"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": {
|
||||
"baz": {
|
||||
"expires": null,
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "quux"
|
||||
},
|
||||
"foo": {
|
||||
"expires": null,
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "bar"
|
||||
}
|
||||
},
|
||||
"headers": {
|
||||
"X-Data": "value",
|
||||
"X-Foo": "bar"
|
||||
}
|
||||
}
|
17
tests/fixtures/session_data/old/headers_dict.json
vendored
Normal file
17
tests/fixtures/session_data/old/headers_dict.json
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.1.0"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": {
|
||||
"foo": "bar",
|
||||
"baz": "quux"
|
||||
}
|
||||
}
|
33
tests/fixtures/session_data/old/headers_dict_extras.json
vendored
Normal file
33
tests/fixtures/session_data/old/headers_dict_extras.json
vendored
Normal file
@@ -0,0 +1,33 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.1.0"
|
||||
},
|
||||
"auth": {
|
||||
"raw_auth": "foo:bar",
|
||||
"type": "basic"
|
||||
},
|
||||
"cookies": [
|
||||
{
|
||||
"domain": null,
|
||||
"name": "baz",
|
||||
"expires": null,
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "quux"
|
||||
},
|
||||
{
|
||||
"domain": null,
|
||||
"name": "foo",
|
||||
"expires": null,
|
||||
"path": "/",
|
||||
"secure": false,
|
||||
"value": "bar"
|
||||
}
|
||||
],
|
||||
"headers": {
|
||||
"X-Data": "value",
|
||||
"X-Foo": "bar"
|
||||
}
|
||||
}
|
23
tests/fixtures/session_data/old/headers_list.json
vendored
Normal file
23
tests/fixtures/session_data/old/headers_list.json
vendored
Normal file
@@ -0,0 +1,23 @@
|
||||
{
|
||||
"__meta__": {
|
||||
"about": "HTTPie session file",
|
||||
"help": "https://httpie.io/docs#sessions",
|
||||
"httpie": "3.2.0"
|
||||
},
|
||||
"auth": {
|
||||
"password": null,
|
||||
"type": null,
|
||||
"username": null
|
||||
},
|
||||
"cookies": [],
|
||||
"headers": [
|
||||
{
|
||||
"name": "X-Data",
|
||||
"value": "value"
|
||||
},
|
||||
{
|
||||
"name": "X-Foo",
|
||||
"value": "bar"
|
||||
}
|
||||
]
|
||||
}
|
Reference in New Issue
Block a user