mongrel2 0.35.0 → 0.36.0
Sign up to get free protection for your applications and to get access to all the features.
- data.tar.gz.sig +0 -0
- data/ChangeLog +113 -2
- data/History.rdoc +12 -0
- data/Rakefile +3 -3
- data/bin/m2sh.rb +7 -8
- data/lib/mongrel2.rb +4 -3
- data/lib/mongrel2/config/directory.rb +5 -5
- data/lib/mongrel2/config/filter.rb +1 -1
- data/lib/mongrel2/config/handler.rb +7 -5
- data/lib/mongrel2/config/host.rb +2 -2
- data/lib/mongrel2/config/log.rb +1 -1
- data/lib/mongrel2/config/mimetype.rb +3 -3
- data/lib/mongrel2/config/proxy.rb +1 -1
- data/lib/mongrel2/config/route.rb +1 -1
- data/lib/mongrel2/config/server.rb +6 -2
- data/lib/mongrel2/config/setting.rb +4 -4
- data/lib/mongrel2/config/statistic.rb +3 -3
- data/lib/mongrel2/connection.rb +3 -2
- data/lib/mongrel2/handler.rb +2 -1
- data/lib/mongrel2/httpresponse.rb +16 -1
- data/lib/mongrel2/request.rb +4 -2
- data/lib/mongrel2/websocket.rb +4 -3
- data/spec/mongrel2/httpresponse_spec.rb +13 -0
- metadata +39 -37
- metadata.gz.sig +0 -0
data.tar.gz.sig
CHANGED
Binary file
|
data/ChangeLog
CHANGED
@@ -1,8 +1,119 @@
|
|
1
|
+
2013-02-06 Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
* .tm_properties:
|
4
|
+
Set indent settings for RSpec too
|
5
|
+
[ad33b0c00c21] [tip]
|
6
|
+
|
7
|
+
* lib/mongrel2/request.rb:
|
8
|
+
Only log if wrapping a non-String body in a StringIO
|
9
|
+
[71eacd47e2b7]
|
10
|
+
|
11
|
+
2013-01-11 Michael Granger <ged@FaerieMUD.org>
|
12
|
+
|
13
|
+
* .rvm.gems, Rakefile, lib/mongrel2.rb,
|
14
|
+
lib/mongrel2/config/handler.rb, lib/mongrel2/config/server.rb:
|
15
|
+
Updated Config model dataset declarations for Sequel versions >
|
16
|
+
3.42.
|
17
|
+
[d1e574e548fb] [github/master]
|
18
|
+
|
19
|
+
2012-12-21 Michael Granger <ged@FaerieMUD.org>
|
20
|
+
|
21
|
+
* bin/m2sh.rb:
|
22
|
+
Fix the 'start' subcommand of m2sh.rb.
|
23
|
+
[4462a9d4f889]
|
24
|
+
|
25
|
+
2012-12-14 Michael Granger <ged@FaerieMUD.org>
|
26
|
+
|
27
|
+
* .hgtags:
|
28
|
+
Added tag v0.35.0 for changeset e2c0f9b4cf4b
|
29
|
+
[9dd24d2824a1]
|
30
|
+
|
31
|
+
* .hgsigs:
|
32
|
+
Added signature for changeset d19a29e2ca5f
|
33
|
+
[e2c0f9b4cf4b] [v0.35.0]
|
34
|
+
|
35
|
+
* History.rdoc, lib/mongrel2.rb:
|
36
|
+
Bump the minor version, update history.
|
37
|
+
[d19a29e2ca5f]
|
38
|
+
|
39
|
+
* lib/mongrel2/websocket.rb, spec/lib/constants.rb,
|
40
|
+
spec/mongrel2/websocket_spec.rb:
|
41
|
+
Allow opcodes to be set on WebSocket frames numerically.
|
42
|
+
[1a69ea26da95]
|
43
|
+
|
44
|
+
2012-12-11 Michael Granger <ged@FaerieMUD.org>
|
45
|
+
|
46
|
+
* lib/mongrel2/connection.rb, lib/mongrel2/websocket.rb,
|
47
|
+
spec/mongrel2/websocket_spec.rb:
|
48
|
+
Add a #socket_id method to all WebSocket frame types.
|
49
|
+
|
50
|
+
* Created a Mongrel2::WebSocket::Methods mixin with the
|
51
|
+
implementation of the method.
|
52
|
+
* Included the new mixin in WebSocket::Frame,
|
53
|
+
WebSocket::ClientHandshake, and WebSocket::ServerHandshake
|
54
|
+
[8e34ca93f26f]
|
55
|
+
|
56
|
+
2012-12-04 Michael Granger <ged@FaerieMUD.org>
|
57
|
+
|
58
|
+
* History.rdoc, lib/mongrel2.rb:
|
59
|
+
Bump the patch version, update history.
|
60
|
+
[20d86c77d502]
|
61
|
+
|
62
|
+
* lib/mongrel2/handler.rb:
|
63
|
+
Ensure the ZMQ context is closed when #run exits.
|
64
|
+
[840f17c017f7]
|
65
|
+
|
66
|
+
2012-10-17 Michael Granger <ged@FaerieMUD.org>
|
67
|
+
|
68
|
+
* .hgtags:
|
69
|
+
Added tag v0.34.0 for changeset ca784c919dd4
|
70
|
+
[d4446ae7d890]
|
71
|
+
|
72
|
+
* .hgsigs:
|
73
|
+
Added signature for changeset 0c87b34361e7
|
74
|
+
[ca784c919dd4] [v0.34.0]
|
75
|
+
|
76
|
+
* History.rdoc, lib/mongrel2.rb:
|
77
|
+
Bump the minor version, update history.
|
78
|
+
[0c87b34361e7]
|
79
|
+
|
80
|
+
* lib/mongrel2/httprequest.rb, spec/mongrel2/httprequest_spec.rb:
|
81
|
+
Fall back to 'http' scheme if running under a Mongrel2 that doesn't
|
82
|
+
set the url-scheme header.
|
83
|
+
[b3ed74c32541]
|
84
|
+
|
85
|
+
* bin/m2sh.rb:
|
86
|
+
'Fix the multiple-server case in 'm2sh.rb start'
|
87
|
+
[8aeffd89cdbb]
|
88
|
+
|
89
|
+
2012-10-16 Michael Granger <ged@FaerieMUD.org>
|
90
|
+
|
91
|
+
* lib/mongrel2/httprequest.rb, spec/mongrel2/httprequest_spec.rb:
|
92
|
+
Add support for the new (edge) 'url-scheme' header
|
93
|
+
|
94
|
+
...and build the #ssl? predicate on top of that.
|
95
|
+
[5f76d0a567fc]
|
96
|
+
|
97
|
+
* examples/config.rb, examples/run:
|
98
|
+
Try to make examples more tolerant of being run from other
|
99
|
+
directories
|
100
|
+
[05317bf262be]
|
101
|
+
|
102
|
+
* lib/mongrel2/testing.rb:
|
103
|
+
Add (1.8.0ish) url-scheme header to the defaults in mongrel2/testing
|
104
|
+
[035b536da40d]
|
105
|
+
|
106
|
+
2012-10-03 Michael Granger <ged@FaerieMUD.org>
|
107
|
+
|
108
|
+
* lib/mongrel2/httpresponse.rb:
|
109
|
+
Remove some more chatty debug logging.
|
110
|
+
[4afe501d5125]
|
111
|
+
|
1
112
|
2012-10-02 Michael Granger <ged@FaerieMUD.org>
|
2
113
|
|
3
114
|
* .hgtags:
|
4
115
|
Added tag v0.33.0 for changeset fcfe03af49a6
|
5
|
-
[b79abaa5e19f]
|
116
|
+
[b79abaa5e19f]
|
6
117
|
|
7
118
|
* .hgsigs:
|
8
119
|
Added signature for changeset 4c64666f4255
|
@@ -105,7 +216,7 @@
|
|
105
216
|
|
106
217
|
* .hgtags:
|
107
218
|
Added tag v0.30.1 for changeset 01750f74082c
|
108
|
-
[8208fbbc6641]
|
219
|
+
[8208fbbc6641]
|
109
220
|
|
110
221
|
* .hgsigs:
|
111
222
|
Added signature for changeset 4ebef57dc78c
|
data/History.rdoc
CHANGED
@@ -1,3 +1,15 @@
|
|
1
|
+
== v0.36.0 [2013-02-28] Michael Granger <ged@FaerieMUD.org>
|
2
|
+
|
3
|
+
- Fixes for Ruby 2.
|
4
|
+
- Fix status line for responses that have an explicit content-length.
|
5
|
+
This is so HEAD responses, for example, don't get reset to '204 No
|
6
|
+
Content' just because their body is empty.
|
7
|
+
- Convert ::for_uuid to a introspection-friendly dataset method.
|
8
|
+
- Only log if wrapping a non-String body in a StringIO
|
9
|
+
- Updated Config model dataset declarations for Sequel versions > 3.42.
|
10
|
+
- Fix the 'start' subcommand of m2sh.rb.
|
11
|
+
|
12
|
+
|
1
13
|
== v0.35.0 [2012-12-11] Michael Granger <ged@FaerieMUD.org>
|
2
14
|
|
3
15
|
- Allow WebSocket frames to be set to reserved opcodes
|
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ hoespec = Hoe.spec 'mongrel2' do
|
|
26
26
|
self.developer 'Michael Granger', 'ged@FaerieMUD.org'
|
27
27
|
|
28
28
|
self.dependency 'nokogiri', '~> 1.5'
|
29
|
-
self.dependency 'sequel', '~> 3.
|
29
|
+
self.dependency 'sequel', '~> 3.44'
|
30
30
|
self.dependency 'tnetstring', '~> 0.3'
|
31
31
|
self.dependency 'yajl-ruby', '~> 1.0'
|
32
32
|
self.dependency 'trollop', '~> 2.0'
|
@@ -35,8 +35,8 @@ hoespec = Hoe.spec 'mongrel2' do
|
|
35
35
|
self.dependency 'loggability','~> 0.5'
|
36
36
|
self.dependency 'sqlite3', '~> 1.3'
|
37
37
|
|
38
|
-
self.dependency 'configurability', '~>
|
39
|
-
self.dependency 'simplecov', '~> 0.
|
38
|
+
self.dependency 'configurability', '~> 2.0', :developer
|
39
|
+
self.dependency 'simplecov', '~> 0.7', :developer
|
40
40
|
self.dependency 'hoe-deveiate', '~> 0.1', :developer
|
41
41
|
|
42
42
|
self.spec_extras[:licenses] = ["BSD"]
|
data/bin/m2sh.rb
CHANGED
@@ -452,18 +452,17 @@ class Mongrel2::M2SHCommand
|
|
452
452
|
# Change into the server's chroot directory so paths line up whether or not
|
453
453
|
# it's started as root
|
454
454
|
|
455
|
-
|
456
|
-
|
455
|
+
message '*' * 70
|
456
|
+
header "Starting mongrel2 at: #{url}"
|
457
|
+
message '*' * 70
|
458
|
+
|
459
|
+
if server.chroot && server.chroot != '' && server.chroot != '.'
|
460
|
+
Dir.chdir( server.chroot )
|
457
461
|
message " changed PWD to: #{Dir.pwd}"
|
458
|
-
Mongrel2::Config.log_action( "Starting server: #{server}", self.options.why )
|
459
|
-
self.log.debug " command is: #{Shellwords.shelljoin(cmd)}"
|
460
|
-
exec( *cmd )
|
461
462
|
end
|
462
463
|
|
463
464
|
Mongrel2::Config.log_action( "Starting server: #{server}", self.options.why )
|
464
|
-
|
465
|
-
header "Starting mongrel2 at: #{url}"
|
466
|
-
message '*' * 70
|
465
|
+
self.log.debug " command is: #{Shellwords.shelljoin(cmd)}"
|
467
466
|
exec( *cmd )
|
468
467
|
end
|
469
468
|
help :start, "Starts a server."
|
data/lib/mongrel2.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# -*- ruby -*-
|
2
|
+
#encoding: utf-8
|
2
3
|
|
3
4
|
require 'loggability'
|
4
5
|
require 'zmq'
|
@@ -20,10 +21,10 @@ module Mongrel2
|
|
20
21
|
abort "\n\n>>> Mongrel2 requires Ruby 1.9.2 or later. <<<\n\n" if RUBY_VERSION < '1.9.2'
|
21
22
|
|
22
23
|
# Library version constant
|
23
|
-
VERSION = '0.
|
24
|
+
VERSION = '0.36.0'
|
24
25
|
|
25
26
|
# Version-control revision constant
|
26
|
-
REVISION = %q$Revision:
|
27
|
+
REVISION = %q$Revision: c7c83589ab0f $
|
27
28
|
|
28
29
|
|
29
30
|
require 'mongrel2/constants'
|
@@ -6,12 +6,12 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Directory (Dir) configuration class
|
7
7
|
class Mongrel2::Config::Directory < Mongrel2::Config( :directory )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
10
|
# CREATE TABLE directory (id INTEGER PRIMARY KEY,
|
11
|
-
#
|
12
|
-
#
|
13
|
-
#
|
14
|
-
#
|
11
|
+
# base TEXT,
|
12
|
+
# index_file TEXT,
|
13
|
+
# default_ctype TEXT,
|
14
|
+
# cache_ttl INTEGER DEFAULT 0);
|
15
15
|
|
16
16
|
### Sequel validation callback: add errors if the record is invalid.
|
17
17
|
def validate
|
@@ -30,7 +30,7 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
30
30
|
#
|
31
31
|
class Mongrel2::Config::Filter < Mongrel2::Config( :filter )
|
32
32
|
|
33
|
-
### As of Mongrel2/1.
|
33
|
+
### As of Mongrel2/1.8.0:
|
34
34
|
# CREATE TABLE filter (id INTEGER PRIMARY KEY,
|
35
35
|
# server_id INTEGER,
|
36
36
|
# name TEXT,
|
@@ -6,14 +6,14 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Handler configuration class
|
7
7
|
class Mongrel2::Config::Handler < Mongrel2::Config( :handler )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
10
|
# CREATE TABLE handler (id INTEGER PRIMARY KEY,
|
11
11
|
# send_spec TEXT,
|
12
12
|
# send_ident TEXT,
|
13
13
|
# recv_spec TEXT,
|
14
14
|
# recv_ident TEXT,
|
15
|
-
#
|
16
|
-
#
|
15
|
+
# raw_payload INTEGER DEFAULT 0,
|
16
|
+
# protocol TEXT DEFAULT 'json');
|
17
17
|
|
18
18
|
|
19
19
|
#
|
@@ -42,8 +42,10 @@ class Mongrel2::Config::Handler < Mongrel2::Config( :handler )
|
|
42
42
|
# :method: by_send_ident( uuid )
|
43
43
|
#
|
44
44
|
# Look up a Handler by its send_ident, which should be a +uuid+ or similar String.
|
45
|
-
|
46
|
-
|
45
|
+
dataset_module do
|
46
|
+
def by_send_ident( ident )
|
47
|
+
return self.filter( :send_ident => ident )
|
48
|
+
end
|
47
49
|
end
|
48
50
|
|
49
51
|
|
data/lib/mongrel2/config/host.rb
CHANGED
@@ -6,8 +6,8 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Host configuration class
|
7
7
|
class Mongrel2::Config::Host < Mongrel2::Config( :host )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
10
|
-
# CREATE TABLE host (id INTEGER PRIMARY KEY,
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
|
+
# CREATE TABLE host (id INTEGER PRIMARY KEY,
|
11
11
|
# server_id INTEGER,
|
12
12
|
# maintenance BOOLEAN DEFAULT 0,
|
13
13
|
# name TEXT,
|
data/lib/mongrel2/config/log.rb
CHANGED
@@ -9,7 +9,7 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
9
9
|
# Mongrel2 configuration Log class
|
10
10
|
class Mongrel2::Config::Log < Mongrel2::Config( :log )
|
11
11
|
|
12
|
-
### As of Mongrel2/1.
|
12
|
+
### As of Mongrel2/1.8.0:
|
13
13
|
# CREATE TABLE log(id INTEGER PRIMARY KEY,
|
14
14
|
# who TEXT,
|
15
15
|
# what TEXT,
|
@@ -6,10 +6,10 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Mimetype configuration class
|
7
7
|
class Mongrel2::Config::Mimetype < Mongrel2::Config( :mimetype )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
10
|
# CREATE TABLE mimetype (id INTEGER PRIMARY KEY,
|
11
|
-
#
|
12
|
-
#
|
11
|
+
# mimetype TEXT,
|
12
|
+
# extension TEXT);
|
13
13
|
|
14
14
|
end # class Mongrel2::Config::Mimetype
|
15
15
|
|
@@ -6,7 +6,7 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Proxy configuration class
|
7
7
|
class Mongrel2::Config::Proxy < Mongrel2::Config( :proxy )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
10
|
# CREATE TABLE proxy (id INTEGER PRIMARY KEY,
|
11
11
|
# addr TEXT,
|
12
12
|
# port INTEGER);
|
@@ -6,7 +6,7 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Route configuration class
|
7
7
|
class Mongrel2::Config::Route < Mongrel2::Config( :route )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
10
|
# CREATE TABLE route (id INTEGER PRIMARY KEY,
|
11
11
|
# path TEXT,
|
12
12
|
# reversed BOOLEAN DEFAULT 0,
|
@@ -12,7 +12,7 @@ require 'mongrel2/constants'
|
|
12
12
|
class Mongrel2::Config::Server < Mongrel2::Config( :server )
|
13
13
|
include Mongrel2::Constants
|
14
14
|
|
15
|
-
### As of Mongrel2/1.
|
15
|
+
### As of Mongrel2/1.8.0:
|
16
16
|
# CREATE TABLE server (id INTEGER PRIMARY KEY,
|
17
17
|
# uuid TEXT,
|
18
18
|
# access_log TEXT,
|
@@ -30,7 +30,11 @@ class Mongrel2::Config::Server < Mongrel2::Config( :server )
|
|
30
30
|
# :singleton-method: by_uuid
|
31
31
|
# :call-seq:
|
32
32
|
# by_uuid( uuid )
|
33
|
-
|
33
|
+
dataset_module do
|
34
|
+
def by_uuid( uuid )
|
35
|
+
filter(:uuid => uuid).limit(1)
|
36
|
+
end
|
37
|
+
end
|
34
38
|
|
35
39
|
|
36
40
|
##
|
@@ -6,10 +6,10 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 Setting configuration class
|
7
7
|
class Mongrel2::Config::Setting < Mongrel2::Config( :setting )
|
8
8
|
|
9
|
-
### As of Mongrel2/1.
|
10
|
-
# CREATE TABLE setting (id INTEGER PRIMARY KEY,
|
11
|
-
#
|
12
|
-
#
|
9
|
+
### As of Mongrel2/1.8.0:
|
10
|
+
# CREATE TABLE setting (id INTEGER PRIMARY KEY,
|
11
|
+
# key TEXT,
|
12
|
+
# value TEXT);
|
13
13
|
|
14
14
|
end # class Mongrel2::Config::Setting
|
15
15
|
|
@@ -6,11 +6,11 @@ require 'mongrel2/config' unless defined?( Mongrel2::Config )
|
|
6
6
|
# Mongrel2 configuration statistic class
|
7
7
|
class Mongrel2::Config::Statistic < Mongrel2::Config( :statistic )
|
8
8
|
|
9
|
-
|
10
|
-
# CREATE TABLE statistic (id SERIAL,
|
9
|
+
# As of Mongrel2-1.8.0:
|
10
|
+
# CREATE TABLE statistic (id SERIAL,
|
11
11
|
# other_type TEXT,
|
12
12
|
# other_id INTEGER,
|
13
|
-
# name
|
13
|
+
# name TEXT,
|
14
14
|
# sum REAL,
|
15
15
|
# sumsq REAL,
|
16
16
|
# n INTEGER,
|
data/lib/mongrel2/connection.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# -*- ruby -*-
|
2
|
+
#encoding: utf-8
|
2
3
|
|
3
4
|
require 'socket'
|
4
5
|
require 'zmq'
|
@@ -123,7 +124,7 @@ class Mongrel2::Connection
|
|
123
124
|
self.check_closed
|
124
125
|
header = "%s %d:%s," % [ sender_id, conn_id.to_s.length, conn_id ]
|
125
126
|
buf = header + ' ' + data
|
126
|
-
self.log.debug "Sending response (PUB)
|
127
|
+
self.log.debug "Sending response (PUB)"
|
127
128
|
self.response_sock.send( buf )
|
128
129
|
self.log.debug " done with send (%d bytes)" % [ buf.bytesize ]
|
129
130
|
end
|
data/lib/mongrel2/handler.rb
CHANGED
@@ -73,7 +73,7 @@ class Mongrel2::HTTPResponse < Mongrel2::Response
|
|
73
73
|
|
74
74
|
### Send the response status to the client
|
75
75
|
def status_line
|
76
|
-
st = self.status ||
|
76
|
+
st = self.status || self.derived_status_code
|
77
77
|
return STATUS_LINE_FORMAT % [ st, HTTP::STATUS_NAME[st] ]
|
78
78
|
end
|
79
79
|
|
@@ -222,6 +222,21 @@ class Mongrel2::HTTPResponse < Mongrel2::Response
|
|
222
222
|
]
|
223
223
|
end
|
224
224
|
|
225
|
+
### Return the numeric HTTP status code for the response bsaed on what has already been
|
226
|
+
### set
|
227
|
+
def derived_status_code
|
228
|
+
# If there's a non-empty entity body, or the content length has been set explicitly
|
229
|
+
# to something non-zero, assume the response is OK
|
230
|
+
if self.body.size.nonzero? ||
|
231
|
+
(self.header.content_length && self.header.content_length.nonzero?)
|
232
|
+
return HTTP::OK
|
233
|
+
|
234
|
+
# otherwise set it to 204
|
235
|
+
else
|
236
|
+
return HTTP::NO_CONTENT
|
237
|
+
end
|
238
|
+
end
|
239
|
+
|
225
240
|
end # class Mongrel2::Response
|
226
241
|
|
227
242
|
# vim: set nosta noet ts=4 sw=4:
|
data/lib/mongrel2/request.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
#-*- ruby -*-
|
2
|
+
#encoding: utf-8
|
2
3
|
|
3
4
|
require 'ipaddr'
|
4
5
|
require 'stringio'
|
@@ -275,7 +276,8 @@ class Mongrel2::Request
|
|
275
276
|
return spoolfile.open( 'r', encoding: enc )
|
276
277
|
|
277
278
|
elsif !( body.respond_to?(:read) && body.respond_to?(:pos) && body.respond_to?(:seek) )
|
278
|
-
self.log.info "Wrapping non-IO (%p) body in a StringIO" % [ body.class ]
|
279
|
+
self.log.info "Wrapping non-IO (%p) body in a StringIO" % [ body.class ] unless
|
280
|
+
body.is_a?( String )
|
279
281
|
|
280
282
|
# Get the object as a String, set the encoding
|
281
283
|
str = body.to_s
|
data/lib/mongrel2/websocket.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
|
1
|
+
# -*- ruby -*-
|
2
|
+
#encoding: utf-8
|
2
3
|
|
3
4
|
require 'mongrel2/request' unless defined?( Mongrel2::Request )
|
4
5
|
require 'mongrel2/constants'
|
@@ -543,8 +544,8 @@ module Mongrel2::WebSocket
|
|
543
544
|
self.payload.set_encoding( 'binary' )
|
544
545
|
self.payload.rewind
|
545
546
|
|
546
|
-
header_i = self.make_header.
|
547
|
-
body_i = self.payload.
|
547
|
+
header_i = self.make_header.each_byte
|
548
|
+
body_i = self.payload.each_byte
|
548
549
|
|
549
550
|
header_i.each_with_index {|byte, i| yielder.yield(byte) }
|
550
551
|
body_i.each_with_index {|byte, i| yielder.yield(byte) }
|
@@ -241,6 +241,19 @@ describe Mongrel2::HTTPResponse do
|
|
241
241
|
end
|
242
242
|
|
243
243
|
|
244
|
+
it "doesn't reset the status to 204 NO CONTENT if there's an explicit content-length header" do
|
245
|
+
|
246
|
+
# Simulate a response to a HEAD request
|
247
|
+
request_factory = Mongrel2::RequestFactory.new( route: '/foo' )
|
248
|
+
@response.request = request_factory.head( '/foo' )
|
249
|
+
|
250
|
+
@response.header.content_length = 2048
|
251
|
+
@response.body = ''
|
252
|
+
|
253
|
+
@response.status_line.should =~ /200 OK/i
|
254
|
+
end
|
255
|
+
|
256
|
+
|
244
257
|
it "can build a valid HTTP status line for its status" do
|
245
258
|
@response.status = HTTP::SEE_OTHER
|
246
259
|
@response.status_line.should == "HTTP/1.1 303 See Other"
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mongrel2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.36.0
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,33 +10,35 @@ autorequire:
|
|
10
10
|
bindir: bin
|
11
11
|
cert_chain:
|
12
12
|
- !binary |-
|
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
|
-
|
13
|
+
LS0tLS1CRUdJTiBDRVJUSUZJQ0FURS0tLS0tCk1JSURiRENDQWxTZ0F3SUJB
|
14
|
+
Z0lCQVRBTkJna3Foa2lHOXcwQkFRVUZBREErTVF3d0NnWURWUVFEREFOblpX
|
15
|
+
UXgKR1RBWEJnb0praWFKay9Jc1pBRVpGZ2xHWVdWeWFXVk5WVVF4RXpBUkJn
|
16
|
+
b0praWFKay9Jc1pBRVpGZ052Y21jdwpIaGNOTVRNd01qSTNNVFkwT0RVNFdo
|
17
|
+
Y05NVFF3TWpJM01UWTBPRFU0V2pBK01Rd3dDZ1lEVlFRRERBTm5aV1F4CkdU
|
18
|
+
QVhCZ29Ka2lhSmsvSXNaQUVaRmdsR1lXVnlhV1ZOVlVReEV6QVJCZ29Ka2lh
|
19
|
+
SmsvSXNaQUVaRmdOdmNtY3cKZ2dFaU1BMEdDU3FHU0liM0RRRUJBUVVBQTRJ
|
20
|
+
QkR3QXdnZ0VLQW9JQkFRRGI5Mm1reVl3dUdCZzFvUnh0MnRrSAorVW8zTEFz
|
21
|
+
YUwvQVBCZlNMenk4bzMrQjNBVUhLQ2pNVWFWZUJvWmRXdE1IQjc1WDNWUWx2
|
22
|
+
WGZaTXlCeGo1OVZvCmNEdGhyM3pkYW80SG55cnpBSVFmN0JPNVk4S0J3VkQr
|
23
|
+
eXlYQ0QvTjY1VFR3cXNRbk8zaWU3VTUvOXV0MXJuTnIKT2tPekFzY013a2ZR
|
24
|
+
eEJrWER6anZBV2E2VUY0YzVjOWtSL1Q3OWlBMjFrRHg5K2JVTWVudFU1OWFD
|
25
|
+
SnRVY2J4YQo3a2NLSmhQRVlzazRPZHhSOXEyZHBoTk1GRFFzSWRSTzhyeXdY
|
26
|
+
NUZSSHZjYitxblhDMTdSdnhMSHRPanlzUHRwCkVXc1lvWk14eUNESnBVcWJ3
|
27
|
+
b2VpTSt0QUhvejJBQk12M0FoaWUzUWViNitNWk5BdE1tYVdmQngzZGcydSsv
|
28
|
+
V04KQWdNQkFBR2pkVEJ6TUFrR0ExVWRFd1FDTUFBd0N3WURWUjBQQkFRREFn
|
29
|
+
U3dNQjBHQTFVZERnUVdCQlNaMGhDVgpxb0hyMTIyZkdLZWxxZmZ6RVFCaHN6
|
30
|
+
QWNCZ05WSFJFRUZUQVRnUkZuWldSQVJtRmxjbWxsVFZWRUxtOXlaekFjCkJn
|
31
|
+
TlZIUklFRlRBVGdSRm5aV1JBUm1GbGNtbGxUVlZFTG05eVp6QU5CZ2txaGtp
|
32
|
+
Rzl3MEJBUVVGQUFPQ0FRRUEKVmxjZnlxNkd3eUU4aTBRdUZQQ2VWT3dKYW5l
|
33
|
+
U3Zjd3gzMTZEQXBqeTkvdHQyWUQySG9tTGJ0cFh0amk1UVhvcgpPTjZvbG40
|
34
|
+
dFdCSUIzS2xicjNzenE1b1IzUmMxRDAyU2FCVGFseFNuZHA0TTZVa1c5aFJG
|
35
|
+
dTVqbjk4cERCNGZxCjVsOHdNTVUwWGRtcXgxVll2eXNWQWpWRlZDL1c0Tk52
|
36
|
+
bG1nKzJtRWdTVlpQNUs2VGM5cURoM2VNUUlub1l3NmgKdDFZQTZSc1VKSHA1
|
37
|
+
dkdReWhQMXgzNFlwTEFhbHk4aWNibnMvOFBxT2Y3T3NuOXp0bWc4Yk9NSkNl
|
38
|
+
YjMyZVFMago2bUtDd2pwZWd5dEUwb2lmWGZGOGs3NUE5MTA1Y0JuTmlNWk9l
|
39
|
+
MXRYaXFZYy9leENnV3ZiZ2d1cnpET2NSa1p1Ci9ZU3VzYWlEWEhLVTJPM0Fr
|
40
|
+
YzNodEE9PQotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
|
41
|
+
date: 2013-03-01 00:00:00.000000000 Z
|
40
42
|
dependencies:
|
41
43
|
- !ruby/object:Gem::Dependency
|
42
44
|
name: nokogiri
|
@@ -61,7 +63,7 @@ dependencies:
|
|
61
63
|
requirements:
|
62
64
|
- - ~>
|
63
65
|
- !ruby/object:Gem::Version
|
64
|
-
version: '3.
|
66
|
+
version: '3.44'
|
65
67
|
type: :runtime
|
66
68
|
prerelease: false
|
67
69
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -69,7 +71,7 @@ dependencies:
|
|
69
71
|
requirements:
|
70
72
|
- - ~>
|
71
73
|
- !ruby/object:Gem::Version
|
72
|
-
version: '3.
|
74
|
+
version: '3.44'
|
73
75
|
- !ruby/object:Gem::Dependency
|
74
76
|
name: tnetstring
|
75
77
|
requirement: !ruby/object:Gem::Requirement
|
@@ -237,7 +239,7 @@ dependencies:
|
|
237
239
|
requirements:
|
238
240
|
- - ~>
|
239
241
|
- !ruby/object:Gem::Version
|
240
|
-
version: '
|
242
|
+
version: '2.0'
|
241
243
|
type: :development
|
242
244
|
prerelease: false
|
243
245
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -245,7 +247,7 @@ dependencies:
|
|
245
247
|
requirements:
|
246
248
|
- - ~>
|
247
249
|
- !ruby/object:Gem::Version
|
248
|
-
version: '
|
250
|
+
version: '2.0'
|
249
251
|
- !ruby/object:Gem::Dependency
|
250
252
|
name: simplecov
|
251
253
|
requirement: !ruby/object:Gem::Requirement
|
@@ -253,7 +255,7 @@ dependencies:
|
|
253
255
|
requirements:
|
254
256
|
- - ~>
|
255
257
|
- !ruby/object:Gem::Version
|
256
|
-
version: '0.
|
258
|
+
version: '0.7'
|
257
259
|
type: :development
|
258
260
|
prerelease: false
|
259
261
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -261,7 +263,7 @@ dependencies:
|
|
261
263
|
requirements:
|
262
264
|
- - ~>
|
263
265
|
- !ruby/object:Gem::Version
|
264
|
-
version: '0.
|
266
|
+
version: '0.7'
|
265
267
|
- !ruby/object:Gem::Dependency
|
266
268
|
name: hoe-deveiate
|
267
269
|
requirement: !ruby/object:Gem::Requirement
|
@@ -285,7 +287,7 @@ dependencies:
|
|
285
287
|
requirements:
|
286
288
|
- - ~>
|
287
289
|
- !ruby/object:Gem::Version
|
288
|
-
version: '3.
|
290
|
+
version: '3.4'
|
289
291
|
type: :development
|
290
292
|
prerelease: false
|
291
293
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -293,7 +295,7 @@ dependencies:
|
|
293
295
|
requirements:
|
294
296
|
- - ~>
|
295
297
|
- !ruby/object:Gem::Version
|
296
|
-
version: '3.
|
298
|
+
version: '3.4'
|
297
299
|
description: ! 'Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for
|
298
300
|
|
299
301
|
Mongrel2[http://mongrel2.org/].
|
@@ -423,7 +425,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
423
425
|
version: '0'
|
424
426
|
requirements: []
|
425
427
|
rubyforge_project: mongrel2
|
426
|
-
rubygems_version: 1.8.
|
428
|
+
rubygems_version: 1.8.25
|
427
429
|
signing_key:
|
428
430
|
specification_version: 3
|
429
431
|
summary: Ruby-Mongrel2 is a complete Ruby (1.9-only) connector for Mongrel2[http://mongrel2.org/]
|
metadata.gz.sig
CHANGED
Binary file
|