thin 0.4.1 → 0.5.0
Sign up to get free protection for your applications and to get access to all the features.
Potentially problematic release.
This version of thin might be problematic. Click here for more details.
- data/COPYING +18 -0
- data/README +32 -45
- data/Rakefile +66 -23
- data/bin/thin +76 -45
- data/doc/benchmarks.txt +64 -249
- data/doc/rdoc/created.rid +1 -1
- data/doc/rdoc/files/README.html +37 -100
- data/doc/rdoc/rdoc-style.css +5 -0
- data/example/config.ru +9 -0
- data/ext/thin_parser/common.rl +54 -0
- data/ext/thin_parser/ext_help.h +14 -0
- data/ext/thin_parser/extconf.rb +6 -0
- data/ext/thin_parser/parser.c +1199 -0
- data/ext/thin_parser/parser.h +49 -0
- data/ext/thin_parser/parser.rl +143 -0
- data/ext/thin_parser/thin.c +424 -0
- data/lib/rack/adapter/rails.rb +136 -0
- data/lib/rack/handler/thin.rb +13 -0
- data/lib/thin.rb +28 -12
- data/lib/thin/connection.rb +47 -0
- data/lib/thin/daemonizing.rb +5 -1
- data/lib/thin/headers.rb +3 -2
- data/lib/thin/logging.rb +6 -13
- data/lib/thin/request.rb +53 -133
- data/lib/thin/response.rb +21 -25
- data/lib/thin/server.rb +30 -94
- data/lib/thin/version.rb +2 -2
- data/lib/thin_parser.bundle +0 -0
- data/spec/daemonizing_spec.rb +94 -0
- data/spec/headers_spec.rb +35 -0
- data/spec/request_spec.rb +258 -0
- data/spec/response_spec.rb +40 -0
- data/spec/server_spec.rb +75 -0
- data/spec/spec_helper.rb +126 -0
- metadata +79 -99
- data/bin/thin_cluster +0 -53
- data/doc/rdoc/classes/Kernel.html +0 -182
- data/doc/rdoc/classes/Process.html +0 -175
- data/doc/rdoc/classes/Thin.html +0 -184
- data/doc/rdoc/classes/Thin/CGIWrapper.html +0 -438
- data/doc/rdoc/classes/Thin/Cluster.html +0 -392
- data/doc/rdoc/classes/Thin/Command.html +0 -221
- data/doc/rdoc/classes/Thin/CommandError.html +0 -154
- data/doc/rdoc/classes/Thin/Commands.html +0 -145
- data/doc/rdoc/classes/Thin/Daemonizable.html +0 -250
- data/doc/rdoc/classes/Thin/Daemonizable/ClassMethods.html +0 -203
- data/doc/rdoc/classes/Thin/DirHandler.html +0 -250
- data/doc/rdoc/classes/Thin/Handler.html +0 -195
- data/doc/rdoc/classes/Thin/Headers.html +0 -244
- data/doc/rdoc/classes/Thin/InvalidRequest.html +0 -150
- data/doc/rdoc/classes/Thin/Logging.html +0 -214
- data/doc/rdoc/classes/Thin/RailsHandler.html +0 -234
- data/doc/rdoc/classes/Thin/RailsServer.html +0 -175
- data/doc/rdoc/classes/Thin/Request.html +0 -379
- data/doc/rdoc/classes/Thin/Response.html +0 -311
- data/doc/rdoc/classes/Thin/Server.html +0 -381
- data/doc/rdoc/files/bin/thin.html +0 -188
- data/doc/rdoc/files/bin/thin_cluster.html +0 -175
- data/doc/rdoc/files/lib/thin/cgi_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/cluster_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/command_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/consts_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/daemonizing_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/handler_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/headers_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/logging_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/mime_types_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/rails_rb.html +0 -263
- data/doc/rdoc/files/lib/thin/recipes_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/request_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/response_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/server_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/statuses_rb.html +0 -171
- data/doc/rdoc/files/lib/thin/version_rb.html +0 -171
- data/lib/thin/cgi.rb +0 -159
- data/lib/thin/cluster.rb +0 -147
- data/lib/thin/command.rb +0 -49
- data/lib/thin/commands/cluster/base.rb +0 -24
- data/lib/thin/commands/cluster/config.rb +0 -36
- data/lib/thin/commands/cluster/restart.rb +0 -35
- data/lib/thin/commands/cluster/start.rb +0 -40
- data/lib/thin/commands/cluster/stop.rb +0 -28
- data/lib/thin/commands/server/base.rb +0 -7
- data/lib/thin/commands/server/start.rb +0 -33
- data/lib/thin/commands/server/stop.rb +0 -29
- data/lib/thin/consts.rb +0 -37
- data/lib/thin/handler.rb +0 -57
- data/lib/thin/mime_types.rb +0 -619
- data/lib/thin/rails.rb +0 -44
- data/lib/thin/recipes.rb +0 -36
- data/lib/transat/parser.rb +0 -247
@@ -1,175 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » Class: Thin::RailsServer
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">home</a></li>
|
53
|
-
<li><a href="/thin/doc/">doc</a></li>
|
54
|
-
<li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
|
55
|
-
<li><a href="/thin/trac.fcgi/browser">code</a></li>
|
56
|
-
<li><a href="/thin/trac.fcgi/report">tickets</a></li>
|
57
|
-
<li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
|
58
|
-
</ul>
|
59
|
-
<div id="sidebar">
|
60
|
-
<h2>Files</h2>
|
61
|
-
<ul class="list">
|
62
|
-
<li><a href="../../files/README.html" value="File: README">README</a></li>
|
63
|
-
<li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.rb</a></li>
|
64
|
-
<li><a href="../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../files/lib/thin/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
|
66
|
-
<li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
|
67
|
-
<li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
68
|
-
<li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
|
69
|
-
<li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
70
|
-
<li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
71
|
-
<li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
|
72
|
-
<li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
|
73
|
-
<li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
|
74
|
-
<li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
75
|
-
<li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
76
|
-
<li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
77
|
-
<li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
78
|
-
<li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
79
|
-
<li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
80
|
-
<li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
|
81
|
-
</ul>
|
82
|
-
|
83
|
-
<h2>Classes</h2>
|
84
|
-
<ul class="list">
|
85
|
-
<li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
86
|
-
<li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</a></li>
|
87
|
-
<li><a href="../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../classes/Thin/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
|
92
|
-
<li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
93
|
-
<li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
|
94
|
-
<li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
|
95
|
-
<li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
96
|
-
<li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
97
|
-
<li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
98
|
-
<li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
|
99
|
-
<li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
100
|
-
<li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
|
101
|
-
<li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
102
|
-
<li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
|
103
|
-
<li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
|
104
|
-
<li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
|
105
|
-
<li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
|
106
|
-
</ul>
|
107
|
-
</div>
|
108
|
-
<div id="container">
|
109
|
-
<div id="header">
|
110
|
-
<a href="/thin/" title="Home">
|
111
|
-
<img id="logo" src="../../logo.gif" />
|
112
|
-
</a>
|
113
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
<div id="content">
|
117
|
-
<h2>Class: Thin::RailsServer</h2>
|
118
|
-
|
119
|
-
|
120
|
-
<div id="Thin::RailsServer" class="page_shade">
|
121
|
-
<div class="page">
|
122
|
-
<h3>Class Thin::RailsServer < <a href="Server.html">Server</a></h3>
|
123
|
-
|
124
|
-
<span class="path">(in files
|
125
|
-
<a href="../../files/lib/thin/rails_rb.html">lib/thin/rails.rb</a>
|
126
|
-
)</span>
|
127
|
-
|
128
|
-
<p>
|
129
|
-
Serve the Rails application in the current directory.
|
130
|
-
</p>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<h4>Includes</h4>
|
136
|
-
<ul>
|
137
|
-
<li><a href="Logging.html">Logging</a></li>
|
138
|
-
<li><a href="Daemonizable.html">Daemonizable</a></li>
|
139
|
-
</ul>
|
140
|
-
|
141
|
-
<h2 class="ruled">Methods</h2>
|
142
|
-
<h4 class="ruled">
|
143
|
-
<span class="method-type" title="Public Class method">Public Class</span>
|
144
|
-
<strong><a name="M000055" href="#M000055" title="Permalink to Public Class method: new">new(address, port, environment='development', cwd='.')</a></strong>
|
145
|
-
</h4>
|
146
|
-
|
147
|
-
|
148
|
-
<div class="sourcecode">
|
149
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000055_source')" id="l_M000055_source">show source</a> ]</p>
|
150
|
-
<div id="M000055_source" class="dyn-source">
|
151
|
-
<pre>
|
152
|
-
<span class="ruby-comment cmt"># File lib/thin/rails.rb, line 36</span>
|
153
|
-
36: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>(<span class="ruby-identifier">address</span>, <span class="ruby-identifier">port</span>, <span class="ruby-identifier">environment</span>=<span class="ruby-value str">'development'</span>, <span class="ruby-identifier">cwd</span>=<span class="ruby-value str">'.'</span>)
|
154
|
-
37: <span class="ruby-keyword kw">super</span> <span class="ruby-identifier">address</span>, <span class="ruby-identifier">port</span>,
|
155
|
-
38: <span class="ruby-comment cmt"># Let Rails handle his thing and ignore files</span>
|
156
|
-
39: <span class="ruby-constant">Thin</span><span class="ruby-operator">::</span><span class="ruby-constant">RailsHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-identifier">cwd</span>, <span class="ruby-identifier">environment</span>),
|
157
|
-
40: <span class="ruby-comment cmt"># Serve static files</span>
|
158
|
-
41: <span class="ruby-constant">Thin</span><span class="ruby-operator">::</span><span class="ruby-constant">DirHandler</span>.<span class="ruby-identifier">new</span>(<span class="ruby-constant">File</span>.<span class="ruby-identifier">join</span>(<span class="ruby-identifier">cwd</span>, <span class="ruby-value str">'public'</span>))
|
159
|
-
42: <span class="ruby-keyword kw">end</span>
|
160
|
-
</pre>
|
161
|
-
</div>
|
162
|
-
</div>
|
163
|
-
|
164
|
-
</div>
|
165
|
-
</div>
|
166
|
-
|
167
|
-
|
168
|
-
</div>
|
169
|
-
</div>
|
170
|
-
<div id="footer">
|
171
|
-
<hr />
|
172
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
173
|
-
</div>
|
174
|
-
</body>
|
175
|
-
</html>
|
@@ -1,379 +0,0 @@
|
|
1
|
-
|
2
|
-
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
3
|
-
<html>
|
4
|
-
<head>
|
5
|
-
<title>
|
6
|
-
thin » Class: Thin::Request
|
7
|
-
</title>
|
8
|
-
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
|
9
|
-
<link rel="stylesheet" href="../.././rdoc-style.css" type="text/css" media="screen" />
|
10
|
-
<script language="JavaScript" type="text/javascript">
|
11
|
-
// <![CDATA[
|
12
|
-
|
13
|
-
function toggleSource( id )
|
14
|
-
{
|
15
|
-
var elem
|
16
|
-
var link
|
17
|
-
|
18
|
-
if( document.getElementById )
|
19
|
-
{
|
20
|
-
elem = document.getElementById( id )
|
21
|
-
link = document.getElementById( "l_" + id )
|
22
|
-
}
|
23
|
-
else if ( document.all )
|
24
|
-
{
|
25
|
-
elem = eval( "document.all." + id )
|
26
|
-
link = eval( "document.all.l_" + id )
|
27
|
-
}
|
28
|
-
else
|
29
|
-
return false;
|
30
|
-
|
31
|
-
if( elem.style.display == "block" )
|
32
|
-
{
|
33
|
-
elem.style.display = "none"
|
34
|
-
link.innerHTML = "show source"
|
35
|
-
}
|
36
|
-
else
|
37
|
-
{
|
38
|
-
elem.style.display = "block"
|
39
|
-
link.innerHTML = "hide source"
|
40
|
-
}
|
41
|
-
}
|
42
|
-
|
43
|
-
function openCode( url )
|
44
|
-
{
|
45
|
-
window.open( url, "SOURCE_CODE", "width=400,height=400,scrollbars=yes" )
|
46
|
-
}
|
47
|
-
// ]]>
|
48
|
-
</script>
|
49
|
-
</head>
|
50
|
-
<body>
|
51
|
-
<ul id="menu">
|
52
|
-
<li><a href="/thin/">home</a></li>
|
53
|
-
<li><a href="/thin/doc/">doc</a></li>
|
54
|
-
<li><a href="/thin/trac.fcgi/timeline">timeline</a></li>
|
55
|
-
<li><a href="/thin/trac.fcgi/browser">code</a></li>
|
56
|
-
<li><a href="/thin/trac.fcgi/report">tickets</a></li>
|
57
|
-
<li><a href="/thin/trac.fcgi/newticket">new ticket</a></li>
|
58
|
-
</ul>
|
59
|
-
<div id="sidebar">
|
60
|
-
<h2>Files</h2>
|
61
|
-
<ul class="list">
|
62
|
-
<li><a href="../../files/README.html" value="File: README">README</a></li>
|
63
|
-
<li><a href="../../files/lib/thin/cgi_rb.html" value="File: cgi.rb">lib/thin/cgi.rb</a></li>
|
64
|
-
<li><a href="../../files/lib/thin/cluster_rb.html" value="File: cluster.rb">lib/thin/cluster.rb</a></li>
|
65
|
-
<li><a href="../../files/lib/thin/command_rb.html" value="File: command.rb">lib/thin/command.rb</a></li>
|
66
|
-
<li><a href="../../files/lib/thin/consts_rb.html" value="File: consts.rb">lib/thin/consts.rb</a></li>
|
67
|
-
<li><a href="../../files/lib/thin/daemonizing_rb.html" value="File: daemonizing.rb">lib/thin/daemonizing.rb</a></li>
|
68
|
-
<li><a href="../../files/lib/thin/handler_rb.html" value="File: handler.rb">lib/thin/handler.rb</a></li>
|
69
|
-
<li><a href="../../files/lib/thin/headers_rb.html" value="File: headers.rb">lib/thin/headers.rb</a></li>
|
70
|
-
<li><a href="../../files/lib/thin/logging_rb.html" value="File: logging.rb">lib/thin/logging.rb</a></li>
|
71
|
-
<li><a href="../../files/lib/thin/mime_types_rb.html" value="File: mime_types.rb">lib/thin/mime_types.rb</a></li>
|
72
|
-
<li><a href="../../files/lib/thin/rails_rb.html" value="File: rails.rb">lib/thin/rails.rb</a></li>
|
73
|
-
<li><a href="../../files/lib/thin/recipes_rb.html" value="File: recipes.rb">lib/thin/recipes.rb</a></li>
|
74
|
-
<li><a href="../../files/lib/thin/request_rb.html" value="File: request.rb">lib/thin/request.rb</a></li>
|
75
|
-
<li><a href="../../files/lib/thin/response_rb.html" value="File: response.rb">lib/thin/response.rb</a></li>
|
76
|
-
<li><a href="../../files/lib/thin/server_rb.html" value="File: server.rb">lib/thin/server.rb</a></li>
|
77
|
-
<li><a href="../../files/lib/thin/statuses_rb.html" value="File: statuses.rb">lib/thin/statuses.rb</a></li>
|
78
|
-
<li><a href="../../files/lib/thin/version_rb.html" value="File: version.rb">lib/thin/version.rb</a></li>
|
79
|
-
<li><a href="../../files/bin/thin.html" value="File: thin">bin/thin</a></li>
|
80
|
-
<li><a href="../../files/bin/thin_cluster.html" value="File: thin_cluster">bin/thin_cluster</a></li>
|
81
|
-
</ul>
|
82
|
-
|
83
|
-
<h2>Classes</h2>
|
84
|
-
<ul class="list">
|
85
|
-
<li><a href="../../classes/Thin.html" title="Module: Thin">Thin</a></li>
|
86
|
-
<li><a href="../../classes/Thin/Commands.html" title="Module: Thin::Commands">Thin::Commands</a></li>
|
87
|
-
<li><a href="../../classes/Thin/Daemonizable.html" title="Module: Thin::Daemonizable">Thin::Daemonizable</a></li>
|
88
|
-
<li><a href="../../classes/Thin/Daemonizable/ClassMethods.html" title="Module: Thin::Daemonizable::ClassMethods">Thin::Daemonizable::ClassMethods</a></li>
|
89
|
-
<li><a href="../../classes/Thin/VERSION.html" title="Module: Thin::VERSION">Thin::VERSION</a></li>
|
90
|
-
<li><a href="../../classes/Thin/Logging.html" title="Module: Thin::Logging">Thin::Logging</a></li>
|
91
|
-
<li><a href="../../classes/Thin/DirHandler.html" title="Class: Thin::DirHandler">Thin::DirHandler</a></li>
|
92
|
-
<li><a href="../../classes/Thin/InvalidRequest.html" title="Class: Thin::InvalidRequest">Thin::InvalidRequest</a></li>
|
93
|
-
<li><a href="../../classes/Thin/CGIWrapper.html" title="Class: Thin::CGIWrapper">Thin::CGIWrapper</a></li>
|
94
|
-
<li><a href="../../classes/Thin/Command.html" title="Class: Thin::Command">Thin::Command</a></li>
|
95
|
-
<li><a href="../../classes/Thin/Response.html" title="Class: Thin::Response">Thin::Response</a></li>
|
96
|
-
<li><a href="../../classes/Thin/Headers.html" title="Class: Thin::Headers">Thin::Headers</a></li>
|
97
|
-
<li><a href="../../classes/Thin/Server.html" title="Class: Thin::Server">Thin::Server</a></li>
|
98
|
-
<li><a href="../../classes/Thin/CommandError.html" title="Class: Thin::CommandError">Thin::CommandError</a></li>
|
99
|
-
<li><a href="../../classes/Thin/Request.html" title="Class: Thin::Request">Thin::Request</a></li>
|
100
|
-
<li><a href="../../classes/Thin/RailsServer.html" title="Class: Thin::RailsServer">Thin::RailsServer</a></li>
|
101
|
-
<li><a href="../../classes/Thin/Cluster.html" title="Class: Thin::Cluster">Thin::Cluster</a></li>
|
102
|
-
<li><a href="../../classes/Thin/RailsHandler.html" title="Class: Thin::RailsHandler">Thin::RailsHandler</a></li>
|
103
|
-
<li><a href="../../classes/Thin/Handler.html" title="Class: Thin::Handler">Thin::Handler</a></li>
|
104
|
-
<li><a href="../../classes/Process.html" title="Module: Process">Process</a></li>
|
105
|
-
<li><a href="../../classes/Kernel.html" title="Module: Kernel">Kernel</a></li>
|
106
|
-
</ul>
|
107
|
-
</div>
|
108
|
-
<div id="container">
|
109
|
-
<div id="header">
|
110
|
-
<a href="/thin/" title="Home">
|
111
|
-
<img id="logo" src="../../logo.gif" />
|
112
|
-
</a>
|
113
|
-
<h2 id="tag_line">A fast and very simple Ruby web server</h2>
|
114
|
-
</div>
|
115
|
-
|
116
|
-
<div id="content">
|
117
|
-
<h2>Class: Thin::Request</h2>
|
118
|
-
|
119
|
-
|
120
|
-
<div id="Thin::Request" class="page_shade">
|
121
|
-
<div class="page">
|
122
|
-
<h3>Class Thin::Request < <a href="Handler.html">Object</a></h3>
|
123
|
-
|
124
|
-
<span class="path">(in files
|
125
|
-
<a href="../../files/lib/thin/request_rb.html">lib/thin/request.rb</a>
|
126
|
-
)</span>
|
127
|
-
|
128
|
-
<p>
|
129
|
-
A request made to the server.
|
130
|
-
</p>
|
131
|
-
|
132
|
-
|
133
|
-
|
134
|
-
|
135
|
-
<h4>Includes</h4>
|
136
|
-
<ul>
|
137
|
-
<li><a href="Logging.html">Logging</a></li>
|
138
|
-
<li><a href="Daemonizable.html">Daemonizable</a></li>
|
139
|
-
</ul>
|
140
|
-
|
141
|
-
<h2 class="ruled">Methods</h2>
|
142
|
-
<h4 class="ruled">
|
143
|
-
<span class="method-type" title="Public Class method">Public Class</span>
|
144
|
-
<strong><a name="M000048" href="#M000048" title="Permalink to Public Class method: new">new()</a></strong>
|
145
|
-
</h4>
|
146
|
-
|
147
|
-
|
148
|
-
<div class="sourcecode">
|
149
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000048_source')" id="l_M000048_source">show source</a> ]</p>
|
150
|
-
<div id="M000048_source" class="dyn-source">
|
151
|
-
<pre>
|
152
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 30</span>
|
153
|
-
30: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">initialize</span>
|
154
|
-
31: <span class="ruby-ivar">@params</span> = {
|
155
|
-
32: <span class="ruby-value str">'GATEWAY_INTERFACE'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">CGI_VERSION</span>,
|
156
|
-
33: <span class="ruby-value str">'HTTP_VERSION'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">HTTP_VERSION</span>,
|
157
|
-
34: <span class="ruby-value str">'SERVER_PROTOCOL'</span> =<span class="ruby-operator">></span> <span class="ruby-constant">HTTP_VERSION</span>
|
158
|
-
35: }
|
159
|
-
36: <span class="ruby-ivar">@body</span> = <span class="ruby-constant">StringIO</span>.<span class="ruby-identifier">new</span>
|
160
|
-
37: <span class="ruby-ivar">@raw</span> = <span class="ruby-value str">''</span>
|
161
|
-
38: <span class="ruby-ivar">@trace</span> = <span class="ruby-keyword kw">false</span>
|
162
|
-
39: <span class="ruby-keyword kw">end</span>
|
163
|
-
</pre>
|
164
|
-
</div>
|
165
|
-
</div>
|
166
|
-
<h4 class="ruled">
|
167
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
168
|
-
<strong><a name="M000052" href="#M000052" title="Permalink to Public Instance method: close">close()</a></strong>
|
169
|
-
</h4>
|
170
|
-
|
171
|
-
|
172
|
-
<div class="sourcecode">
|
173
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000052_source')" id="l_M000052_source">show source</a> ]</p>
|
174
|
-
<div id="M000052_source" class="dyn-source">
|
175
|
-
<pre>
|
176
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 132</span>
|
177
|
-
132: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">close</span>
|
178
|
-
133: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">close</span>
|
179
|
-
134: <span class="ruby-keyword kw">end</span>
|
180
|
-
</pre>
|
181
|
-
</div>
|
182
|
-
</div>
|
183
|
-
<h4 class="ruled">
|
184
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
185
|
-
<strong><a name="M000053" href="#M000053" title="Permalink to Public Instance method: content_length">content_length()</a></strong>
|
186
|
-
</h4>
|
187
|
-
|
188
|
-
|
189
|
-
<div class="sourcecode">
|
190
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000053_source')" id="l_M000053_source">show source</a> ]</p>
|
191
|
-
<div id="M000053_source" class="dyn-source">
|
192
|
-
<pre>
|
193
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 136</span>
|
194
|
-
136: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">content_length</span>
|
195
|
-
137: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'CONTENT_LENGTH'</span>].<span class="ruby-identifier">to_i</span>
|
196
|
-
138: <span class="ruby-keyword kw">end</span>
|
197
|
-
</pre>
|
198
|
-
</div>
|
199
|
-
</div>
|
200
|
-
<h4 class="ruled">
|
201
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
202
|
-
<strong><a name="M000049" href="#M000049" title="Permalink to Public Instance method: parse!">parse!(content)</a></strong>
|
203
|
-
</h4>
|
204
|
-
|
205
|
-
<p>
|
206
|
-
Parse the headers and body from the <tt>content</tt> buffer.
|
207
|
-
</p>
|
208
|
-
|
209
|
-
<div class="sourcecode">
|
210
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000049_source')" id="l_M000049_source">show source</a> ]</p>
|
211
|
-
<div id="M000049_source" class="dyn-source">
|
212
|
-
<pre>
|
213
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 42</span>
|
214
|
-
42: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse!</span>(<span class="ruby-identifier">content</span>)
|
215
|
-
43: <span class="ruby-identifier">parse_headers!</span> <span class="ruby-identifier">content</span>
|
216
|
-
44: <span class="ruby-identifier">parse_body!</span> <span class="ruby-identifier">content</span> <span class="ruby-keyword kw">if</span> <span class="ruby-constant">BODYFUL_METHODS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">verb</span>)
|
217
|
-
45: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">InvalidRequest</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
218
|
-
46: <span class="ruby-identifier">raise</span>
|
219
|
-
47: <span class="ruby-keyword kw">rescue</span> <span class="ruby-constant">Object</span> =<span class="ruby-operator">></span> <span class="ruby-identifier">e</span>
|
220
|
-
48: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-identifier">e</span>.<span class="ruby-identifier">message</span>
|
221
|
-
49: <span class="ruby-keyword kw">end</span>
|
222
|
-
</pre>
|
223
|
-
</div>
|
224
|
-
</div>
|
225
|
-
<h4 class="ruled">
|
226
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
227
|
-
<strong><a name="M000051" href="#M000051" title="Permalink to Public Instance method: parse_body!">parse_body!(content)</a></strong>
|
228
|
-
</h4>
|
229
|
-
|
230
|
-
<p>
|
231
|
-
Parse the request body by chunks. We assume the Content-Length is valid and
|
232
|
-
is the actual size of the body. This is garanteed when used behind a proxy
|
233
|
-
server like Nginx:
|
234
|
-
</p>
|
235
|
-
<pre>
|
236
|
-
Note that when using the HTTP Proxy Module (or even when using FastCGI), the entire client
|
237
|
-
request will be buffered in nginx before being passed on to the backend proxied servers.
|
238
|
-
As a result, upload progress meters will not function correctly if they work by measuring
|
239
|
-
the data received by the backend servers.
|
240
|
-
- http://wiki.codemongers.com/NginxHttpProxyModule
|
241
|
-
</pre>
|
242
|
-
<p>
|
243
|
-
On Apache w/ mod_proxy, you need to install mod_accel : <a
|
244
|
-
href="http://sysoev.ru/en">sysoev.ru/en</a>/
|
245
|
-
</p>
|
246
|
-
|
247
|
-
<div class="sourcecode">
|
248
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000051_source')" id="l_M000051_source">show source</a> ]</p>
|
249
|
-
<div id="M000051_source" class="dyn-source">
|
250
|
-
<pre>
|
251
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 121</span>
|
252
|
-
121: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_body!</span>(<span class="ruby-identifier">content</span>)
|
253
|
-
122: <span class="ruby-identifier">length</span> = <span class="ruby-identifier">content_length</span>
|
254
|
-
123: <span class="ruby-keyword kw">while</span> <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator"><</span> <span class="ruby-identifier">length</span>
|
255
|
-
124: <span class="ruby-identifier">chunk</span> = <span class="ruby-identifier">content</span>.<span class="ruby-identifier">readpartial</span>(<span class="ruby-constant">CHUNK_SIZE</span>)
|
256
|
-
125: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">chunk</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">chunk</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-value">0</span>
|
257
|
-
126: <span class="ruby-ivar">@body</span> <span class="ruby-operator"><<</span> <span class="ruby-identifier">chunk</span>
|
258
|
-
127: <span class="ruby-keyword kw">end</span>
|
259
|
-
128:
|
260
|
-
129: <span class="ruby-ivar">@body</span>.<span class="ruby-identifier">rewind</span>
|
261
|
-
130: <span class="ruby-keyword kw">end</span>
|
262
|
-
</pre>
|
263
|
-
</div>
|
264
|
-
</div>
|
265
|
-
<h4 class="ruled">
|
266
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
267
|
-
<strong><a name="M000050" href="#M000050" title="Permalink to Public Instance method: parse_headers!">parse_headers!(content)</a></strong>
|
268
|
-
</h4>
|
269
|
-
|
270
|
-
<p>
|
271
|
-
Parse the request headers from the socket into CGI like variables. Parse
|
272
|
-
the request according to <a
|
273
|
-
href="http://www.w3.org/Protocols/rfc2616/rfc2616.html">www.w3.org/Protocols/rfc2616/rfc2616.html</a>.
|
274
|
-
Parse env variables according to <a
|
275
|
-
href="http://www.ietf.org/rfc/rfc3875">www.ietf.org/rfc/rfc3875</a>. Raises
|
276
|
-
an <a href="InvalidRequest.html">InvalidRequest</a> error when the request
|
277
|
-
is not valid, because:
|
278
|
-
</p>
|
279
|
-
<ul>
|
280
|
-
<li>no valid request line
|
281
|
-
|
282
|
-
</li>
|
283
|
-
<li>uri, path or header is too long
|
284
|
-
|
285
|
-
</li>
|
286
|
-
</ul>
|
287
|
-
|
288
|
-
<div class="sourcecode">
|
289
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000050_source')" id="l_M000050_source">show source</a> ]</p>
|
290
|
-
<div id="M000050_source" class="dyn-source">
|
291
|
-
<pre>
|
292
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 57</span>
|
293
|
-
57: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">parse_headers!</span>(<span class="ruby-identifier">content</span>)
|
294
|
-
58: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">readline</span>(<span class="ruby-identifier">content</span>).<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^([A-Z]+) (.*?)(?:#(.*))? HTTP/</span>)
|
295
|
-
59: <span class="ruby-ivar">@verb</span>, <span class="ruby-identifier">uri</span>, <span class="ruby-identifier">fragment</span> = <span class="ruby-identifier">matches</span>[<span class="ruby-value">1</span>,<span class="ruby-value">3</span>]
|
296
|
-
60: <span class="ruby-keyword kw">else</span>
|
297
|
-
61: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'No valid request line found'</span>
|
298
|
-
62: <span class="ruby-keyword kw">end</span>
|
299
|
-
63:
|
300
|
-
64: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'No method specified'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-ivar">@verb</span>
|
301
|
-
65: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'No URI specified'</span> <span class="ruby-keyword kw">unless</span> <span class="ruby-identifier">uri</span>
|
302
|
-
66:
|
303
|
-
67: <span class="ruby-comment cmt"># Validate various length for security</span>
|
304
|
-
68: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'URI too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_REQUEST_URI_LENGTH</span>
|
305
|
-
69: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'Fragment too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fragment</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">fragment</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_FRAGMENT_LENGTH</span>
|
306
|
-
70:
|
307
|
-
71: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">uri</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^(.*?)(?:\?(.*))?$/</span>)
|
308
|
-
72: <span class="ruby-ivar">@path</span>, <span class="ruby-identifier">query_string</span> = <span class="ruby-identifier">matches</span>[<span class="ruby-value">1</span>,<span class="ruby-value">2</span>]
|
309
|
-
73: <span class="ruby-keyword kw">else</span>
|
310
|
-
74: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-node">"No valid path found in #{uri}"</span>
|
311
|
-
75: <span class="ruby-keyword kw">end</span>
|
312
|
-
76:
|
313
|
-
77: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'Request path too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@path</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_REQUEST_PATH_LENGTH</span>
|
314
|
-
78: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'Query string path too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">query_string</span> <span class="ruby-operator">&&</span> <span class="ruby-identifier">query_string</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_QUERY_STRING_LENGTH</span>
|
315
|
-
79:
|
316
|
-
80: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'REQUEST_URI'</span>] = <span class="ruby-identifier">uri</span>
|
317
|
-
81: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'FRAGMENT'</span>] = <span class="ruby-identifier">fragment</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">fragment</span>
|
318
|
-
82: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'REQUEST_PATH'</span>] =
|
319
|
-
83: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'PATH_INFO'</span>] = <span class="ruby-ivar">@path</span>
|
320
|
-
84: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'SCRIPT_NAME'</span>] = <span class="ruby-value str">'/'</span>
|
321
|
-
85: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'REQUEST_METHOD'</span>] = <span class="ruby-ivar">@verb</span>
|
322
|
-
86: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'QUERY_STRING'</span>] = <span class="ruby-identifier">query_string</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">query_string</span>
|
323
|
-
87:
|
324
|
-
88: <span class="ruby-comment cmt"># Parse all headers from 'Something-Weird' into @params['HTTP_SOMETHING_WEIRD']</span>
|
325
|
-
89: <span class="ruby-identifier">headers_size</span> = <span class="ruby-value">0</span>
|
326
|
-
90: <span class="ruby-keyword kw">until</span> <span class="ruby-identifier">content</span>.<span class="ruby-identifier">eof?</span>
|
327
|
-
91: <span class="ruby-identifier">line</span> = <span class="ruby-identifier">readline</span>(<span class="ruby-identifier">content</span>)
|
328
|
-
92: <span class="ruby-identifier">headers_size</span> <span class="ruby-operator">+=</span> <span class="ruby-identifier">line</span>.<span class="ruby-identifier">size</span>
|
329
|
-
93:
|
330
|
-
94: <span class="ruby-keyword kw">break</span> <span class="ruby-keyword kw">if</span> <span class="ruby-value">?\r</span> <span class="ruby-operator">==</span> <span class="ruby-identifier">line</span>[<span class="ruby-value">0</span>] <span class="ruby-comment cmt"># Reached the end of the headers</span>
|
331
|
-
95: <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">matches</span> = <span class="ruby-identifier">line</span>.<span class="ruby-identifier">match</span>(<span class="ruby-regexp re">/^([\w\-]+): (.*)$/</span>)
|
332
|
-
96: <span class="ruby-identifier">name</span>, <span class="ruby-identifier">value</span> = <span class="ruby-identifier">matches</span>[<span class="ruby-value">1</span>,<span class="ruby-value">2</span>]
|
333
|
-
97: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'Header name too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">name</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_FIELD_NAME_LENGTH</span>
|
334
|
-
98: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'Header value too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">value</span>.<span class="ruby-identifier">size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_FIELD_VALUE_LENGTH</span>
|
335
|
-
99: <span class="ruby-comment cmt"># Transform headers into a HTTP_NAME => value hash</span>
|
336
|
-
100: <span class="ruby-identifier">prefix</span> = <span class="ruby-constant">HTTP_LESS_HEADERS</span>.<span class="ruby-identifier">include?</span>(<span class="ruby-identifier">name</span>) <span class="ruby-operator">?</span> <span class="ruby-value str">''</span> <span class="ruby-operator">:</span> <span class="ruby-value str">'HTTP_'</span>
|
337
|
-
101: <span class="ruby-identifier">params</span>[<span class="ruby-node">"#{prefix}#{name.upcase.gsub('-', '_')}"</span>] = <span class="ruby-identifier">value</span>.<span class="ruby-identifier">chomp</span>
|
338
|
-
102: <span class="ruby-keyword kw">else</span>
|
339
|
-
103: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-node">"Expected header : #{line}"</span>
|
340
|
-
104: <span class="ruby-keyword kw">end</span>
|
341
|
-
105: <span class="ruby-keyword kw">end</span>
|
342
|
-
106:
|
343
|
-
107: <span class="ruby-identifier">raise</span> <span class="ruby-constant">InvalidRequest</span>, <span class="ruby-value str">'Headers too long'</span> <span class="ruby-keyword kw">if</span> <span class="ruby-identifier">headers_size</span> <span class="ruby-operator">></span> <span class="ruby-constant">MAX_HEADER_LENGTH</span>
|
344
|
-
108:
|
345
|
-
109: <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'SERVER_NAME'</span>] = <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'HTTP_HOST'</span>].<span class="ruby-identifier">split</span>(<span class="ruby-value str">':'</span>)[<span class="ruby-value">0</span>] <span class="ruby-keyword kw">if</span> <span class="ruby-ivar">@params</span>[<span class="ruby-value str">'HTTP_HOST'</span>]
|
346
|
-
110: <span class="ruby-keyword kw">end</span>
|
347
|
-
</pre>
|
348
|
-
</div>
|
349
|
-
</div>
|
350
|
-
<h4 class="ruled">
|
351
|
-
<span class="method-type" title="Public Instance method">Public Instance</span>
|
352
|
-
<strong><a name="M000054" href="#M000054" title="Permalink to Public Instance method: to_s">to_s()</a></strong>
|
353
|
-
</h4>
|
354
|
-
|
355
|
-
|
356
|
-
<div class="sourcecode">
|
357
|
-
<p class="source-link">[ <a href="javascript:toggleSource('M000054_source')" id="l_M000054_source">show source</a> ]</p>
|
358
|
-
<div id="M000054_source" class="dyn-source">
|
359
|
-
<pre>
|
360
|
-
<span class="ruby-comment cmt"># File lib/thin/request.rb, line 140</span>
|
361
|
-
140: <span class="ruby-keyword kw">def</span> <span class="ruby-identifier">to_s</span>
|
362
|
-
141: <span class="ruby-node">"#{@params['REQUEST_METHOD']} #{@params['REQUEST_URI']}"</span>
|
363
|
-
142: <span class="ruby-keyword kw">end</span>
|
364
|
-
</pre>
|
365
|
-
</div>
|
366
|
-
</div>
|
367
|
-
|
368
|
-
</div>
|
369
|
-
</div>
|
370
|
-
|
371
|
-
|
372
|
-
</div>
|
373
|
-
</div>
|
374
|
-
<div id="footer">
|
375
|
-
<hr />
|
376
|
-
© <a href="http://macournoyer.com">Marc-André Cournoyer</a>
|
377
|
-
</div>
|
378
|
-
</body>
|
379
|
-
</html>
|