nethttputils 0.3.2.9 → 0.3.2.10
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 +4 -2
- 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: ee1c0a46857d320778ba8a0816cd7e3cb7018fe9
|
4
|
+
data.tar.gz: 1ade1c1f815b7fd75924cdcbed5ce4b732a51570
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7598d560362cee4112042c59a2710b5d757b29fd3eb4153093f2058ba8c7d7802b9f0ac72c9a9a11c1d2947ae104907c3b0dafb9a2def12d47a5662a59605fa6
|
7
|
+
data.tar.gz: cc0d7b860a63b7076ee405ded44f0b3c6c0183534b40cc1d6a1ac9030f23f6b06be9d1063a9c4da96325360a9f7fe298b4e336fb2b8295420ace73b4cef5dbf4
|
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
|
-
|
207
|
+
next logger.warn "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
|
@@ -357,16 +357,18 @@ if $0 == __FILE__
|
|
357
357
|
res.cookies.push WEBrick::Cookie.new("8", "9")
|
358
358
|
res.cookies.push WEBrick::Cookie.new("a", "b")
|
359
359
|
res.cookies.push WEBrick::Cookie.new("1", "5")
|
360
|
+
res.cookies.push WEBrick::Cookie.new("f", "g h")
|
360
361
|
res.status = 300
|
361
362
|
res["location"] = "/2"
|
362
363
|
end
|
363
364
|
server.mount_proc "/2" do |req, res|
|
364
365
|
res.cookies.push WEBrick::Cookie.new("3", "6=c")
|
366
|
+
res.cookies.push WEBrick::Cookie.new("a", "d e")
|
365
367
|
res.cookies.push WEBrick::Cookie.new("8", "")
|
366
368
|
res.cookies.push WEBrick::Cookie.new("4", "7")
|
367
369
|
end
|
368
370
|
t = Thread.new{ server.start }
|
369
|
-
fail unless %w{ 3=6=c 8= 4=7 1=5 a=b } == p(NetHTTPUtils.request_data("http://localhost:8000/1").
|
371
|
+
fail unless %w{ 3=6=c a=d\ e 8= 4=7 1=5 a=b } == p(NetHTTPUtils.request_data("http://localhost:8000/1").
|
370
372
|
instance_variable_get(:@last_response).to_hash.fetch("set-cookie"))
|
371
373
|
server.shutdown
|
372
374
|
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.10"
|
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 --
|