http 0.9.8 → 0.9.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGES.md +12 -0
- data/lib/http/headers.rb +6 -5
- data/lib/http/redirector.rb +2 -0
- data/lib/http/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e30cb4fb424a8cc7177fef986701d40f763c79f1
|
4
|
+
data.tar.gz: c591281ad736c5981881378c5f02aebe34d2770d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9158b6f918b5bd8400fb1c5467058198e63b910b651bd5fc950e95f3481f84ba84c94a8e1e59f817185ff4b346e426bb3c4554eca1f22db8db5a5fff84c9b74d
|
7
|
+
data.tar.gz: efb3e652ed99710318b3fff185db47bd99234a8f1777e6ff77029150b2c05fa422dd5da7ee0e1bc8c2132ba3a269626422d2b44290750c9d772ca0edb1ee8f36
|
data/CHANGES.md
CHANGED
@@ -1,9 +1,21 @@
|
|
1
|
+
## 0.9.9 (2016-03-16)
|
2
|
+
|
3
|
+
* *BACKPORT* [#318](https://github.com/httprb/http/pull/318)
|
4
|
+
Remove redundant string allocations upon header names normalization.
|
5
|
+
([@ixti])
|
6
|
+
|
7
|
+
* *BACKPORT* [#295](https://github.com/httprb/http/pull/295):
|
8
|
+
Fix redirect following when used with persistent mode.
|
9
|
+
([@ixti])
|
10
|
+
|
11
|
+
|
1
12
|
## 0.9.8 (2015-09-29)
|
2
13
|
|
3
14
|
* [#260](https://github.com/httprb/http/pull/258):
|
4
15
|
Fixed global timeout persisting time left across requests when reusing connections.
|
5
16
|
([@zanker][])
|
6
17
|
|
18
|
+
|
7
19
|
## 0.9.7 (2015-09-19)
|
8
20
|
|
9
21
|
* [#258](https://github.com/httprb/http/pull/258):
|
data/lib/http/headers.rb
CHANGED
@@ -11,11 +11,11 @@ module HTTP
|
|
11
11
|
include Enumerable
|
12
12
|
|
13
13
|
# Matches HTTP header names when in "Canonical-Http-Format"
|
14
|
-
|
14
|
+
CANONICAL_NAME_RE = /^[A-Z][a-z]*(?:-[A-Z][a-z]*)*$/
|
15
15
|
|
16
16
|
# Matches valid header field name according to RFC.
|
17
17
|
# @see http://tools.ietf.org/html/rfc7230#section-3.2
|
18
|
-
|
18
|
+
COMPLIANT_NAME_RE = /^[A-Za-z0-9!#\$%&'*+\-.^_`|~]+$/
|
19
19
|
|
20
20
|
# Class constructor.
|
21
21
|
def initialize
|
@@ -194,10 +194,11 @@ module HTTP
|
|
194
194
|
# match {HEADER_NAME_RE}
|
195
195
|
# @return [String] canonical HTTP header name
|
196
196
|
def normalize_header(name)
|
197
|
-
|
198
|
-
normalized ||= name.split(/[\-_]/).map(&:capitalize).join("-")
|
197
|
+
return name if name =~ CANONICAL_NAME_RE
|
199
198
|
|
200
|
-
|
199
|
+
normalized = name.split(/[\-_]/).each(&:capitalize!).join("-")
|
200
|
+
|
201
|
+
return normalized if normalized =~ COMPLIANT_NAME_RE
|
201
202
|
|
202
203
|
fail InvalidHeaderNameError, "Invalid HTTP header field name: #{name.inspect}"
|
203
204
|
end
|
data/lib/http/redirector.rb
CHANGED
data/lib/http/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: http
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.9.
|
4
|
+
version: 0.9.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tony Arcieri
|
@@ -11,7 +11,7 @@ authors:
|
|
11
11
|
autorequire:
|
12
12
|
bindir: bin
|
13
13
|
cert_chain: []
|
14
|
-
date:
|
14
|
+
date: 2016-03-16 00:00:00.000000000 Z
|
15
15
|
dependencies:
|
16
16
|
- !ruby/object:Gem::Dependency
|
17
17
|
name: http_parser.rb
|
@@ -184,7 +184,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
184
184
|
version: '0'
|
185
185
|
requirements: []
|
186
186
|
rubyforge_project:
|
187
|
-
rubygems_version: 2.
|
187
|
+
rubygems_version: 2.2.5
|
188
188
|
signing_key:
|
189
189
|
specification_version: 4
|
190
190
|
summary: HTTP should be easy
|