1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
module WEBrick
class HTTPRequest
@config: Hash[Symbol, untyped]
@buffer_size: Integer
@logger: Log
@query: Hash[String, HTTPUtils::FormData]?
@body: String
@remaining_size: Integer?
@socket: TCPSocket?
@forwarded_proto: String?
@host: String?
@port: Integer?
@body_tmp: Array[String]
@body_rd: Fiber
@request_bytes: Integer
@forwarded_server: String?
@forwarded_host: String?
@forwarded_port: Integer?
@forwarded_for: String?
BODY_CONTAINABLE_METHODS: Array[String]
attr_reader request_line: String?
attr_reader request_method: String?
attr_reader unparsed_uri: String?
attr_reader http_version: HTTPVersion?
attr_reader request_uri: URI::Generic?
attr_reader path: String?
attr_accessor script_name: String?
attr_accessor path_info: String?
attr_accessor query_string: String?
attr_reader raw_header: Array[String]
attr_reader header: Hash[String, Array[String]]?
attr_reader cookies: Array[Cookie]
attr_reader accept: Array[String]
attr_reader accept_charset: Array[String]
attr_reader accept_encoding: Array[String]
attr_reader accept_language: Array[String]
attr_accessor user: String?
attr_reader addr: ([String, Integer, String, String] | [])
attr_reader peeraddr: ([String, Integer, String, String] | [])
attr_reader attributes: Hash[untyped, untyped]
attr_reader keep_alive: bool
attr_reader request_time: Time?
def initialize: (Hash[Symbol, untyped] config) -> void
def parse: (?TCPSocket? socket) -> void
def continue: () -> void
type body_chunk_block = ^(String body_chunk) -> void
def body: () ?{ (String body_chunk) -> void } -> String
def body_reader: () -> self
# for IO.copy_stream.
def readpartial: (Integer size, ?String buf) -> String
def query: () -> Hash[String, HTTPUtils::FormData]
def content_length: () -> Integer
def content_type: () -> String?
def []: (String header_name) -> String?
def each: [T] () { (String, String) -> T } -> T?
def host: () -> String?
def port: () -> Integer?
def server_name: () -> String?
def remote_ip: () -> String?
def ssl?: () -> bool
def keep_alive?: () -> bool
def to_s: () -> String
def fixup: () -> void
def meta_vars: () -> Hash[String, String]
private
MAX_URI_LENGTH: Integer
# same as Mongrel, Thin and Puma
MAX_HEADER_LENGTH: Integer
def read_request_line: (IO socket) -> void
def read_header: (IO socket) -> void
def parse_uri: (String str, ?String scheme) -> URI::Generic
HOST_PATTERN: Regexp
def parse_host_request_line: (String host) -> [String, String]
def read_body: (IO socket, body_chunk_block block) -> String
| (nil socket, top block) -> nil
def read_chunk_size: (IO socket) -> [Integer, String?]
def read_chunked: (IO socket, body_chunk_block block) -> void
def _read_data: (IO io, Symbol method, *untyped arg) -> String?
def read_line: (IO io, ?Integer size) -> String?
def read_data: (IO io, Integer size) -> String?
def parse_query: () -> void
PrivateNetworkRegexp: Regexp
# It's said that all X-Forwarded-* headers will contain more than one
# (comma-separated) value if the original request already contained one of
# these headers. Since we could use these values as Host header, we choose
# the initial(first) value. (apr_table_mergen() adds new value after the
# existing value with ", " prefix)
def setup_forwarded_info: () -> void
end
end
|