Skip to content

Commit 27842db

Browse files
Merge #1521
1521: Convert http-data to pretty JSON r=jtgeibel a=jtgeibel The includes the following changes to the test logic: * http-data is now generated with `serde_json::to_string_pretty()` * The User-Agent header is ignored so that it doesn't cause conflicts when reqwest is updated * The body is now encoded as a base64 string because a byte slice is serialized with one byte per line. This makes JSON responses from GitHub opaque, but that was the case with byte slices as well. The script that was used to do the conversion is archived in the first commit, but removed in the second. Co-authored-by: Justin Geibel <[email protected]>
2 parents 98206a5 + 46b0f97 commit 27842db

36 files changed

+7362
-56
lines changed

Cargo.lock

Lines changed: 13 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ flate2 = "1.0"
3434
semver = "0.5"
3535
url = "1.2.1"
3636
tar = "0.4.13"
37+
base64 = "0.9"
3738

3839
openssl = "0.9.14"
3940
oauth2 = "0.3"
Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
[{"request":{"uri":"http://alexcrichton-test.s3.amazonaws.com/crates/foobadger/foobadger-1.0.0.crate","method":"PUT","headers":[["accept","*/*"],["accept-encoding","gzip"],["user-agent","reqwest/0.9.1"],["authorization","AWS AKIAICL5IWUZYWWKA7JA:kDm23yhf8YuOKpTcbHhNBa6BtQw="],["content-length","35"],["content-type","application/x-tar"],["date","Fri, 15 Sep 2017 07:53:05 -0700"],["host","alexcrichton-test.s3.amazonaws.com"]],"body":[31,139,8,0,0,0,0,0,0,255,237,192,1,1,0,0,0,130,32,255,175,110,72,80,192,171,1,46,175,181,239,0,4,0,0]},"response":{"status":200,"headers":[["Server","AmazonS3"],["x-amz-id-2","0/6/0sEHhOcZrrbuV7bwaKRjkpt9tRXEElKebeZNRK8DoEfSdnTFO/gfr0Zj86ZR726bMeuwuv4="],["ETag","\"f9016ad360cebb4fe2e6e96e5949f022\""],["date","Fri, 15 Sep 2017 14:53:07 GMT"],["content-length","0"],["x-amz-request-id","042143F2421CB177"]],"body":[]}}]
1+
[
2+
{
3+
"request": {
4+
"uri": "http://alexcrichton-test.s3.amazonaws.com/crates/foobadger/foobadger-1.0.0.crate",
5+
"method": "PUT",
6+
"headers": [
7+
[
8+
"accept",
9+
"*/*"
10+
],
11+
[
12+
"date",
13+
"Fri, 15 Sep 2017 07:53:05 -0700"
14+
],
15+
[
16+
"content-length",
17+
"35"
18+
],
19+
[
20+
"authorization",
21+
"AWS AKIAICL5IWUZYWWKA7JA:kDm23yhf8YuOKpTcbHhNBa6BtQw="
22+
],
23+
[
24+
"user-agent",
25+
"reqwest/0.9.1"
26+
],
27+
[
28+
"host",
29+
"alexcrichton-test.s3.amazonaws.com"
30+
],
31+
[
32+
"content-type",
33+
"application/x-tar"
34+
],
35+
[
36+
"accept-encoding",
37+
"gzip"
38+
]
39+
],
40+
"body": "H4sIAAAAAAAA/+3AAQEAAACCIP+vbkhQwKsBLq+17wAEAAA="
41+
},
42+
"response": {
43+
"status": 200,
44+
"headers": [
45+
[
46+
"Server",
47+
"AmazonS3"
48+
],
49+
[
50+
"ETag",
51+
"\"f9016ad360cebb4fe2e6e96e5949f022\""
52+
],
53+
[
54+
"content-length",
55+
"0"
56+
],
57+
[
58+
"x-amz-id-2",
59+
"0/6/0sEHhOcZrrbuV7bwaKRjkpt9tRXEElKebeZNRK8DoEfSdnTFO/gfr0Zj86ZR726bMeuwuv4="
60+
],
61+
[
62+
"x-amz-request-id",
63+
"042143F2421CB177"
64+
],
65+
[
66+
"date",
67+
"Fri, 15 Sep 2017 14:53:07 GMT"
68+
]
69+
],
70+
"body": ""
71+
}
72+
}
73+
]
Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
[{"request":{"uri":"http://alexcrichton-test.s3.amazonaws.com/crates/foo_good_cat/foo_good_cat-1.0.0.crate","method":"PUT","headers":[["date","Fri, 15 Sep 2017 07:53:05 -0700"],["authorization","AWS AKIAICL5IWUZYWWKA7JA:Im1mLvCQhM33OHARbpyyZYiZ9jE="],["accept-encoding","gzip"],["user-agent","reqwest/0.9.1"],["accept","*/*"],["content-type","application/x-tar"],["host","alexcrichton-test.s3.amazonaws.com"],["content-length","35"]],"body":[31,139,8,0,0,0,0,0,0,255,237,192,1,1,0,0,0,130,32,255,175,110,72,80,192,171,1,46,175,181,239,0,4,0,0]},"response":{"status":200,"headers":[["Server","AmazonS3"],["x-amz-id-2","YakCRWvFv2xQT/tB0+Z44KnaWWs/LqMmXJXENGujPnNPOlkwbg5T33XRyHbSJtOEBXETKAXdrZI="],["x-amz-request-id","E9C1F36ED4D753C3"],["ETag","\"f9016ad360cebb4fe2e6e96e5949f022\""],["date","Fri, 15 Sep 2017 14:53:07 GMT"],["content-length","0"]],"body":[]}}]
1+
[
2+
{
3+
"request": {
4+
"uri": "http://alexcrichton-test.s3.amazonaws.com/crates/foo_good_cat/foo_good_cat-1.0.0.crate",
5+
"method": "PUT",
6+
"headers": [
7+
[
8+
"host",
9+
"alexcrichton-test.s3.amazonaws.com"
10+
],
11+
[
12+
"accept-encoding",
13+
"gzip"
14+
],
15+
[
16+
"content-type",
17+
"application/x-tar"
18+
],
19+
[
20+
"content-length",
21+
"35"
22+
],
23+
[
24+
"authorization",
25+
"AWS AKIAICL5IWUZYWWKA7JA:Im1mLvCQhM33OHARbpyyZYiZ9jE="
26+
],
27+
[
28+
"date",
29+
"Fri, 15 Sep 2017 07:53:05 -0700"
30+
],
31+
[
32+
"user-agent",
33+
"reqwest/0.9.1"
34+
],
35+
[
36+
"accept",
37+
"*/*"
38+
]
39+
],
40+
"body": "H4sIAAAAAAAA/+3AAQEAAACCIP+vbkhQwKsBLq+17wAEAAA="
41+
},
42+
"response": {
43+
"status": 200,
44+
"headers": [
45+
[
46+
"x-amz-request-id",
47+
"E9C1F36ED4D753C3"
48+
],
49+
[
50+
"Server",
51+
"AmazonS3"
52+
],
53+
[
54+
"ETag",
55+
"\"f9016ad360cebb4fe2e6e96e5949f022\""
56+
],
57+
[
58+
"x-amz-id-2",
59+
"YakCRWvFv2xQT/tB0+Z44KnaWWs/LqMmXJXENGujPnNPOlkwbg5T33XRyHbSJtOEBXETKAXdrZI="
60+
],
61+
[
62+
"date",
63+
"Fri, 15 Sep 2017 14:53:07 GMT"
64+
],
65+
[
66+
"content-length",
67+
"0"
68+
]
69+
],
70+
"body": ""
71+
}
72+
}
73+
]
Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
[{"request":{"uri":"http://alexcrichton-test.s3.amazonaws.com/crates/foo_ignored_badge/foo_ignored_badge-1.0.0.crate","method":"PUT","headers":[["accept","*/*"],["date","Fri, 15 Sep 2017 07:53:05 -0700"],["host","alexcrichton-test.s3.amazonaws.com"],["content-type","application/x-tar"],["accept-encoding","gzip"],["user-agent","reqwest/0.9.1"],["content-length","35"],["authorization","AWS AKIAICL5IWUZYWWKA7JA:d5z7PoInZdjSdMpMeR61v/ZnsRE="]],"body":[31,139,8,0,0,0,0,0,0,255,237,192,1,1,0,0,0,130,32,255,175,110,72,80,192,171,1,46,175,181,239,0,4,0,0]},"response":{"status":200,"headers":[["Server","AmazonS3"],["date","Fri, 15 Sep 2017 14:53:07 GMT"],["x-amz-request-id","6B48927A9B90CFF0"],["ETag","\"f9016ad360cebb4fe2e6e96e5949f022\""],["x-amz-id-2","n8HEiySuglMWYp3qgLANtS8v47tmBJgyFi0i3UdksOWd1aofssPNuRCNr0/j4Ej1sKt91OMoI5w="],["content-length","0"]],"body":[]}}]
1+
[
2+
{
3+
"request": {
4+
"uri": "http://alexcrichton-test.s3.amazonaws.com/crates/foo_ignored_badge/foo_ignored_badge-1.0.0.crate",
5+
"method": "PUT",
6+
"headers": [
7+
[
8+
"accept",
9+
"*/*"
10+
],
11+
[
12+
"authorization",
13+
"AWS AKIAICL5IWUZYWWKA7JA:d5z7PoInZdjSdMpMeR61v/ZnsRE="
14+
],
15+
[
16+
"host",
17+
"alexcrichton-test.s3.amazonaws.com"
18+
],
19+
[
20+
"content-length",
21+
"35"
22+
],
23+
[
24+
"user-agent",
25+
"reqwest/0.9.1"
26+
],
27+
[
28+
"accept-encoding",
29+
"gzip"
30+
],
31+
[
32+
"date",
33+
"Fri, 15 Sep 2017 07:53:05 -0700"
34+
],
35+
[
36+
"content-type",
37+
"application/x-tar"
38+
]
39+
],
40+
"body": "H4sIAAAAAAAA/+3AAQEAAACCIP+vbkhQwKsBLq+17wAEAAA="
41+
},
42+
"response": {
43+
"status": 200,
44+
"headers": [
45+
[
46+
"x-amz-request-id",
47+
"6B48927A9B90CFF0"
48+
],
49+
[
50+
"content-length",
51+
"0"
52+
],
53+
[
54+
"Server",
55+
"AmazonS3"
56+
],
57+
[
58+
"x-amz-id-2",
59+
"n8HEiySuglMWYp3qgLANtS8v47tmBJgyFi0i3UdksOWd1aofssPNuRCNr0/j4Ej1sKt91OMoI5w="
60+
],
61+
[
62+
"ETag",
63+
"\"f9016ad360cebb4fe2e6e96e5949f022\""
64+
],
65+
[
66+
"date",
67+
"Fri, 15 Sep 2017 14:53:07 GMT"
68+
]
69+
],
70+
"body": ""
71+
}
72+
}
73+
]
Lines changed: 73 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1,73 @@
1-
[{"request":{"uri":"http://alexcrichton-test.s3.amazonaws.com/crates/foo_ignored_cat/foo_ignored_cat-1.0.0.crate","method":"PUT","headers":[["content-type","application/x-tar"],["host","alexcrichton-test.s3.amazonaws.com"],["accept-encoding","gzip"],["user-agent","reqwest/0.9.1"],["accept","*/*"],["authorization","AWS AKIAICL5IWUZYWWKA7JA:V37kbEzeh57sB4yTSZIOJACPoP4="],["content-length","35"],["date","Fri, 15 Sep 2017 07:53:06 -0700"]],"body":[31,139,8,0,0,0,0,0,0,255,237,192,1,1,0,0,0,130,32,255,175,110,72,80,192,171,1,46,175,181,239,0,4,0,0]},"response":{"status":200,"headers":[["x-amz-id-2","m2T+IGVTurpCTLS3pmhcHrpbLGeL0mDQ90vroViQ2v2Sc1/woSi09kpm0BvRl24/0sMonCW7td4="],["content-length","0"],["date","Fri, 15 Sep 2017 14:53:07 GMT"],["x-amz-request-id","6435C4EA7602CE4E"],["ETag","\"f9016ad360cebb4fe2e6e96e5949f022\""],["Server","AmazonS3"]],"body":[]}}]
1+
[
2+
{
3+
"request": {
4+
"uri": "http://alexcrichton-test.s3.amazonaws.com/crates/foo_ignored_cat/foo_ignored_cat-1.0.0.crate",
5+
"method": "PUT",
6+
"headers": [
7+
[
8+
"content-length",
9+
"35"
10+
],
11+
[
12+
"user-agent",
13+
"reqwest/0.9.1"
14+
],
15+
[
16+
"authorization",
17+
"AWS AKIAICL5IWUZYWWKA7JA:V37kbEzeh57sB4yTSZIOJACPoP4="
18+
],
19+
[
20+
"host",
21+
"alexcrichton-test.s3.amazonaws.com"
22+
],
23+
[
24+
"accept-encoding",
25+
"gzip"
26+
],
27+
[
28+
"content-type",
29+
"application/x-tar"
30+
],
31+
[
32+
"accept",
33+
"*/*"
34+
],
35+
[
36+
"date",
37+
"Fri, 15 Sep 2017 07:53:06 -0700"
38+
]
39+
],
40+
"body": "H4sIAAAAAAAA/+3AAQEAAACCIP+vbkhQwKsBLq+17wAEAAA="
41+
},
42+
"response": {
43+
"status": 200,
44+
"headers": [
45+
[
46+
"date",
47+
"Fri, 15 Sep 2017 14:53:07 GMT"
48+
],
49+
[
50+
"content-length",
51+
"0"
52+
],
53+
[
54+
"Server",
55+
"AmazonS3"
56+
],
57+
[
58+
"x-amz-request-id",
59+
"6435C4EA7602CE4E"
60+
],
61+
[
62+
"x-amz-id-2",
63+
"m2T+IGVTurpCTLS3pmhcHrpbLGeL0mDQ90vroViQ2v2Sc1/woSi09kpm0BvRl24/0sMonCW7td4="
64+
],
65+
[
66+
"ETag",
67+
"\"f9016ad360cebb4fe2e6e96e5949f022\""
68+
]
69+
],
70+
"body": ""
71+
}
72+
}
73+
]

0 commit comments

Comments
 (0)