nethttputils 0.3.2.8 → 0.3.2.9
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/nethttputils.rb +3 -3
- data/nethttputils.gemspec +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 197097c1a40d4d0d409aa0c9f0965957ee9daf2a
|
|
4
|
+
data.tar.gz: 5f78308fd5162565db7eca00c630fd2c5e39197e
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: c9275a5dc752288e03877fc8fbbad9fa3b808cca7a7aa463fbb6b7e55c8bc0466cff9c278896a3e7df6084dbca49ea725ab97dbae6dbc465e436e552b9dacedf
|
|
7
|
+
data.tar.gz: f84dbb68971f7aae2c51200e42b95f9492b9b5c1749be2c2bd5870a751a920527d1e93733e77036d629c1cff69b39664243a7cbb39828a88115625362e070282
|
data/lib/nethttputils.rb
CHANGED
|
@@ -204,7 +204,7 @@ module NetHTTPUtils
|
|
|
204
204
|
# TODO: use WEBrick::Cookie
|
|
205
205
|
old_cookies = cookies.dup
|
|
206
206
|
response.to_hash.fetch("set-cookie", []).each do |c|
|
|
207
|
-
fail "bad cookie? #{c.inspect}" unless /\A([^\s=]+)=([^\s
|
|
207
|
+
fail "bad cookie? #{c.inspect}" unless /\A([^\s=]+)=([^\s]*)\z/.match c.split(/\s*;\s*/).first
|
|
208
208
|
logger.debug "set-cookie: #{$1}=#{$2}"
|
|
209
209
|
old_cookies.delete $1
|
|
210
210
|
cookies.store $1, $2
|
|
@@ -361,12 +361,12 @@ if $0 == __FILE__
|
|
|
361
361
|
res["location"] = "/2"
|
|
362
362
|
end
|
|
363
363
|
server.mount_proc "/2" do |req, res|
|
|
364
|
-
res.cookies.push WEBrick::Cookie.new("3", "6")
|
|
364
|
+
res.cookies.push WEBrick::Cookie.new("3", "6=c")
|
|
365
365
|
res.cookies.push WEBrick::Cookie.new("8", "")
|
|
366
366
|
res.cookies.push WEBrick::Cookie.new("4", "7")
|
|
367
367
|
end
|
|
368
368
|
t = Thread.new{ server.start }
|
|
369
|
-
fail unless %w{ 3=6 8= 4=7 1=5 a=b } == p(NetHTTPUtils.request_data("http://localhost:8000/1").
|
|
369
|
+
fail unless %w{ 3=6=c 8= 4=7 1=5 a=b } == p(NetHTTPUtils.request_data("http://localhost:8000/1").
|
|
370
370
|
instance_variable_get(:@last_response).to_hash.fetch("set-cookie"))
|
|
371
371
|
server.shutdown
|
|
372
372
|
t.join
|
data/nethttputils.gemspec
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
Gem::Specification.new do |spec|
|
|
2
2
|
spec.name = "nethttputils"
|
|
3
|
-
spec.version = "0.3.2.
|
|
3
|
+
spec.version = "0.3.2.9"
|
|
4
4
|
spec.summary = "this tool is like a pet that I adopted young and now I depend on, sorry"
|
|
5
5
|
spec.description = <<-EOF
|
|
6
6
|
Back in 2015 I was a guy automating things at my job and two scripts had a common need --
|