lowloop 0.8.7 → 0.8.8
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/connections/connection_manager.rb +2 -2
- data/lib/responses/response_builder.rb +1 -6
- data/lib/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: bfe9d4f8e5d6e9ffff362e2b8d5c0c645bd418a320a6a51aac79fdc67cd3bd66
|
|
4
|
+
data.tar.gz: ccabed591fd8a1c21f129bf8d7dbf8c6dd887d44fc6d2c458638ec4b29b97b0c
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 3a76bc518c204e4a3e77f24dbd3c7183a74b01419f97992c3dca6606f9c0918f5c02fbac613525f3755a400305b6bb36153ca84a0e60ed974eb7bbba61650ce8
|
|
7
|
+
data.tar.gz: 10e3235fcf3b7634bcfde96e0ed4c129fdd9ae5c05a24a97628ae121f50fb882943bfcc6973c6cdd74e2e9c1eb532219d98c8a2958c4e16c83a40df59ad0cbaf
|
|
@@ -37,7 +37,7 @@ module Low
|
|
|
37
37
|
|
|
38
38
|
version ||= request.version
|
|
39
39
|
unless headers_valid?(request)
|
|
40
|
-
ResponseBuilder.respond(
|
|
40
|
+
ResponseBuilder.respond(socket:, response: ResponseFactory.status(code: 400), keep_alive: false)
|
|
41
41
|
break
|
|
42
42
|
end
|
|
43
43
|
|
|
@@ -45,7 +45,7 @@ module Low
|
|
|
45
45
|
|
|
46
46
|
response = respond_to(request:)
|
|
47
47
|
|
|
48
|
-
ResponseBuilder.respond(
|
|
48
|
+
ResponseBuilder.respond(socket:, response:, keep_alive:)
|
|
49
49
|
end
|
|
50
50
|
end
|
|
51
51
|
|
|
@@ -4,7 +4,7 @@ module Low
|
|
|
4
4
|
class ResponseBuilder
|
|
5
5
|
class << self
|
|
6
6
|
# TODO: Use Async wherever we can where it doesn't have "Task" requirement.
|
|
7
|
-
def respond(
|
|
7
|
+
def respond(socket:, response:, keep_alive: true)
|
|
8
8
|
file_body = response.body.respond_to?(:file)
|
|
9
9
|
|
|
10
10
|
if file_body
|
|
@@ -18,7 +18,6 @@ module Low
|
|
|
18
18
|
# Build the whole head in memory then write once, as every socket write is a syscall.
|
|
19
19
|
head = +''
|
|
20
20
|
write_status_line(head, response)
|
|
21
|
-
write_host_header(head, config)
|
|
22
21
|
write_response_headers(head, response)
|
|
23
22
|
write_final_headers(head, content_length, keep_alive)
|
|
24
23
|
|
|
@@ -38,10 +37,6 @@ module Low
|
|
|
38
37
|
head << "#{response.version} #{response.status}\r\n"
|
|
39
38
|
end
|
|
40
39
|
|
|
41
|
-
def write_host_header(head, config)
|
|
42
|
-
head << (config.port.nil? ? "Host: #{config.host}\r\n" : "Host: #{config.host}:#{config.port}\r\n")
|
|
43
|
-
end
|
|
44
|
-
|
|
45
40
|
def write_response_headers(head, response)
|
|
46
41
|
response.headers.fields.each do |key, value|
|
|
47
42
|
next if %w[content-length connection].include?(key.to_s.downcase)
|
data/lib/version.rb
CHANGED