segregate 0.5.3 → 0.5.5
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/segregate.rb +4 -12
- data/lib/segregate/http_regular_expressions.rb +1 -1
- data/lib/segregate/version.rb +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: a8a2fe5b5f775232c83f94a827265ba6a9625fc3
|
4
|
+
data.tar.gz: 77c340f7fe206a0c0398b7505f3b627c0df547ec
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3f869e55b8faf9ecb9d257ce32dac4082ac74d185ac04a9ddab5d800d9b5a55593e064d0094c5eae2631416f6a51aab849edebd08126cc392cc9bcb9afa42a2b
|
7
|
+
data.tar.gz: db1b10304734bcb0fa481af2706a310168ebba4418acd73df5faedc9ef7ce009189fbb9cc50dc277ef4b067c92e0f89bcf15bf894b3192567c743dcf66dbc222
|
data/lib/segregate.rb
CHANGED
@@ -24,7 +24,7 @@ class Segregate
|
|
24
24
|
|
25
25
|
def debug message
|
26
26
|
if @debug
|
27
|
-
puts "DEBUG: " + message.
|
27
|
+
puts "DEBUG: " + message.to_s
|
28
28
|
end
|
29
29
|
end
|
30
30
|
|
@@ -92,12 +92,8 @@ class Segregate
|
|
92
92
|
|
93
93
|
def update_content_length
|
94
94
|
unless @body.empty?
|
95
|
-
if @
|
96
|
-
@headers['transfer-encoding'] = 'chunked'
|
97
|
-
@headers.delete 'content-length'
|
98
|
-
else
|
95
|
+
if @headers['content-length']
|
99
96
|
@headers['content-length'] = @body.length.to_s
|
100
|
-
@headers.delete 'transfer-encoding'
|
101
97
|
end
|
102
98
|
end
|
103
99
|
end
|
@@ -124,10 +120,8 @@ class Segregate
|
|
124
120
|
if @headers['content-length']
|
125
121
|
raw_message << @body
|
126
122
|
elsif @headers['transfer-encoding'] == 'chunked'
|
127
|
-
@body.
|
128
|
-
|
129
|
-
raw_message << chunk + "\r\n"
|
130
|
-
end
|
123
|
+
raw_message << "%s\r\n" % (@body.size.to_s(16))
|
124
|
+
raw_message << @body + "\r\n"
|
131
125
|
raw_message << "0\r\n\r\n"
|
132
126
|
end
|
133
127
|
end
|
@@ -180,8 +174,6 @@ class Segregate
|
|
180
174
|
parse_request_line line
|
181
175
|
elsif line =~ STATUS_LINE
|
182
176
|
parse_status_line line
|
183
|
-
elsif line =~ UNKNOWN_REQUEST_LINE
|
184
|
-
debug "Unknown http method: %s" % line[/^\S+/]
|
185
177
|
else
|
186
178
|
debug "Unknown first line: %s" % line
|
187
179
|
end
|
data/lib/segregate/version.rb
CHANGED