tp2 0.11.1 → 0.11.2
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/CHANGELOG.md +4 -0
- data/lib/tp2/http1_adapter.rb +12 -2
- data/lib/tp2/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 69d5ffc704823ef9650889a3b0ce785aa9aae379905940672ad89ecb6dca0d2b
|
4
|
+
data.tar.gz: 8375c0c32f27279c104351821c2dc07ec5dd7ae5b735b64ce3d5dfa774a95c64
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6c9ac7ee73752d17d56dcdbb9d87bb74a0712f93328f7b8d57352de069595b45e9cf94d67f178828e39ee2a792e19f760550e9c2d08f7e11f3eaeb929e56e16
|
7
|
+
data.tar.gz: e0665223dba5271296c2fa8ab4aa624a280a97a86af609e9fd3ff5b9a3f215b65012f7d077f1fca3a5dc8dd698fbe96a8294c87d76bd2383a552aadb064c4bc5
|
data/CHANGELOG.md
CHANGED
data/lib/tp2/http1_adapter.rb
CHANGED
@@ -208,17 +208,28 @@ module TP2
|
|
208
208
|
return if !@opts[:log]
|
209
209
|
|
210
210
|
request_headers = request.headers
|
211
|
+
uri = full_uri(request_headers)
|
212
|
+
|
211
213
|
str = format(
|
212
214
|
"%<client_ip>s %<method>s %<uri>s %<status>s %<tx>d",
|
213
215
|
client_ip: request.forwarded_for || '?',
|
214
216
|
method: request_headers[':method'].upcase,
|
215
|
-
uri:
|
217
|
+
uri: uri,
|
216
218
|
status: @status,
|
217
219
|
tx: request_headers[':tx']
|
218
220
|
)
|
219
221
|
@opts[:log].log(str)
|
220
222
|
end
|
221
223
|
|
224
|
+
def full_uri(headers)
|
225
|
+
format(
|
226
|
+
"%s://%s%s",
|
227
|
+
headers['x_forwarded_proto'] || 'http',
|
228
|
+
headers['host'],
|
229
|
+
headers[':path']
|
230
|
+
)
|
231
|
+
end
|
232
|
+
|
222
233
|
RE_REQUEST_LINE = /^([a-z]+)\s+([^\s]+)\s+(http\/[0-9\.]{1,3})/i.freeze
|
223
234
|
RE_HEADER_LINE = /^([a-z0-9\-]+)\:\s+(.+)/i.freeze
|
224
235
|
MAX_REQUEST_LINE_LEN = 1 << 14 # 16KB
|
@@ -252,7 +263,6 @@ module TP2
|
|
252
263
|
headers[m[1].downcase] = m[2]
|
253
264
|
end
|
254
265
|
|
255
|
-
headers[':scheme'] = headers['x_forwarded_proto'] || 'http'
|
256
266
|
headers
|
257
267
|
end
|
258
268
|
|
data/lib/tp2/version.rb
CHANGED