mongrel2 0.33.0 → 0.34.0

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.
data.tar.gz.sig CHANGED
Binary file
data/ChangeLog CHANGED
@@ -1,8 +1,32 @@
1
+ 2012-10-02 Michael Granger <ged@FaerieMUD.org>
2
+
3
+ * .hgtags:
4
+ Added tag v0.33.0 for changeset fcfe03af49a6
5
+ [b79abaa5e19f] [tip]
6
+
7
+ * .hgsigs:
8
+ Added signature for changeset 4c64666f4255
9
+ [fcfe03af49a6] [v0.33.0]
10
+
11
+ * History.rdoc, data/mongrel2/bootstrap.html, examples/async-
12
+ upload.rb:
13
+ Update the examples.
14
+ [4c64666f4255]
15
+
16
+ * lib/mongrel2.rb, lib/mongrel2/handler.rb,
17
+ spec/mongrel2/handler_spec.rb:
18
+ Add deferred signal-handling to Mongrel2::Handler.
19
+ [8703559eacf1]
20
+
21
+ * lib/mongrel2/connection.rb:
22
+ Whitespace fix
23
+ [1dbd2c6523aa]
24
+
1
25
  2012-09-21 Michael Granger <ged@FaerieMUD.org>
2
26
 
3
27
  * spec/lib/helpers.rb:
4
28
  Use Loggability's spec helpers
5
- [36f9259ea9aa] [tip]
29
+ [36f9259ea9aa]
6
30
 
7
31
  * lib/mongrel2/request.rb:
8
32
  Don't log the whole damn request in debugging
@@ -81,7 +105,7 @@
81
105
 
82
106
  * .hgtags:
83
107
  Added tag v0.30.1 for changeset 01750f74082c
84
- [8208fbbc6641]
108
+ [8208fbbc6641] [github/master]
85
109
 
86
110
  * .hgsigs:
87
111
  Added signature for changeset 4ebef57dc78c
@@ -375,7 +399,7 @@
375
399
  examples/config.rb, lib/mongrel2/config.rb,
376
400
  lib/mongrel2/httprequest.rb, spec/mongrel2/config_spec.rb:
377
401
  Change Config.settings to a Table, small fixups for async upload.
378
- [e2384875455d]
402
+ [e2384875455d] [github/master@default]
379
403
 
380
404
  * .tm_properties, data/mongrel2/bootstrap.html, examples/.env,
381
405
  examples/Procfile, examples/async-upload.rb, examples/config.rb,
@@ -1,3 +1,14 @@
1
+ == v0.34.0 [2012-10-17] Michael Granger <ged@FaerieMUD.org>
2
+
3
+ - Fix the multiple-server case in 'm2sh.rb start'
4
+ - Add support for the new (edge) 'url-scheme' header and add an #ssl?
5
+ predicate build on it.
6
+ - Try to make examples more tolerant of being run from other
7
+ directories
8
+ - Add (1.8.0ish) url-scheme header to the defaults in mongrel2/testing
9
+ - Remove some more chatty debug logging.
10
+
11
+
1
12
  == v0.33.0 [2012-10-02] Michael Granger <ged@FaerieMUD.org>
2
13
 
3
14
  - Implement deferred signal-handling for Mongrel2::Handler
@@ -678,7 +678,7 @@ class Mongrel2::M2SHCommand
678
678
  # that it would have matched.
679
679
  if servers.length == 1
680
680
  server = servers.first if !serverspec ||
681
- servers.first.values_at( :uuid, :default_host, :name ).include?( serverspec )
681
+ servers.first.values.values_at( :uuid, :default_host, :name ).include?( serverspec )
682
682
 
683
683
  # Otherwise, require an argument and search for the desired server if there is one
684
684
  else
@@ -13,7 +13,7 @@ basedir = examples_dir.parent
13
13
  upload_dir = Pathname( Dir.tmpdir )
14
14
 
15
15
  # samples server
16
- server 'examples' do
16
+ s = server 'examples' do
17
17
 
18
18
  name 'Examples'
19
19
  default_host 'localhost'
@@ -55,4 +55,6 @@ mkdir_p 'var/mongrel2'
55
55
  mkdir_p 'logs'
56
56
  mkdir_p '/tmp/mongrel2-uploads'
57
57
 
58
+ puts "Will chroot to: #{s.chroot}"
58
59
  puts "Upload dir is: #{upload_dir}"
60
+
@@ -9,7 +9,7 @@ examplesdir=$(dirname $0)
9
9
 
10
10
  echo "Creating/updating the config database..."
11
11
  ruby -rubygems -I${examplesdir}/../lib $examplesdir/../bin/m2sh.rb \
12
- -c examples.sqlite load $examplesdir/config.rb
12
+ -c ${examplesdir}/examples.sqlite load $examplesdir/config.rb
13
13
 
14
14
  if [ $? != 0 ]; then
15
15
  echo "Oops, problems installing the config DB. Aborting."
@@ -20,10 +20,10 @@ module Mongrel2
20
20
  abort "\n\n>>> Mongrel2 requires Ruby 1.9.2 or later. <<<\n\n" if RUBY_VERSION < '1.9.2'
21
21
 
22
22
  # Library version constant
23
- VERSION = '0.33.0'
23
+ VERSION = '0.34.0'
24
24
 
25
25
  # Version-control revision constant
26
- REVISION = %q$Revision: 8703559eacf1 $
26
+ REVISION = %q$Revision: 0c87b34361e7 $
27
27
 
28
28
 
29
29
  require 'mongrel2/constants'
@@ -88,6 +88,21 @@ class Mongrel2::HTTPRequest < Mongrel2::Request
88
88
  end
89
89
 
90
90
 
91
+ ### Convenience method for getting the request's 'url-scheme' header.
92
+ def scheme
93
+ return self.headers.url_scheme || 'http'
94
+ end
95
+
96
+
97
+ ### Returns +true+ if the request's URL scheme indicates that it used an HTTPS connection. This
98
+ ### only works on versions of Mongrel2 *after* 1.8.0.
99
+ def ssl?
100
+ return self.scheme == 'https'
101
+ end
102
+ alias_method :used_ssl?, :ssl?
103
+ alias_method :secure?, :ssl?
104
+
105
+
91
106
  #########
92
107
  protected
93
108
  #########
@@ -73,10 +73,7 @@ class Mongrel2::HTTPResponse < Mongrel2::Response
73
73
 
74
74
  ### Send the response status to the client
75
75
  def status_line
76
- self.log.debug "Building status line for status: %p" % [ self.status ]
77
-
78
76
  st = self.status || (self.body.size.zero? ? HTTP::NO_CONTENT : HTTP::OK)
79
-
80
77
  return STATUS_LINE_FORMAT % [ st, HTTP::STATUS_NAME[st] ]
81
78
  end
82
79
 
@@ -69,16 +69,17 @@ module Mongrel2
69
69
 
70
70
  # The default set of headers used for HTTP requests
71
71
  DEFAULT_TESTING_HEADERS = {
72
- "x-forwarded-for" => "127.0.0.1",
73
- "accept-language" => "en-US,en;q=0.8",
74
- "accept-encoding" => "gzip,deflate,sdch",
75
- "connection" => "keep-alive",
76
- "accept-charset" => "UTF-8,*;q=0.5",
77
- "accept" => "text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8",
78
- "user-agent" => "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) " +
79
- "AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 " +
80
- "Safari/535.1",
81
- "VERSION" => "HTTP/1.1",
72
+ 'x-forwarded-for' => '127.0.0.1',
73
+ 'accept-language' => 'en-US,en;q=0.8',
74
+ 'accept-encoding' => 'gzip,deflate,sdch',
75
+ 'connection' => 'keep-alive',
76
+ 'accept-charset' => 'UTF-8,*;q=0.5',
77
+ 'accept' => 'text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8',
78
+ 'user-agent' => 'Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_1) ' +
79
+ 'AppleWebKit/535.1 (KHTML, like Gecko) Chrome/13.0.782.112 ' +
80
+ 'Safari/535.1',
81
+ 'url-scheme' => 'http',
82
+ 'VERSION' => 'HTTP/1.1',
82
83
  }
83
84
 
84
85
  # The defaults used by the HTTP request factory
@@ -79,6 +79,21 @@ describe Mongrel2::HTTPRequest do
79
79
  @req.should be_keepalive()
80
80
  end
81
81
 
82
+ it "knows what its URL scheme was" do
83
+ @req.scheme.should == 'http'
84
+ end
85
+
86
+ it "falls back to 'http' if the url_scheme isn't provided (mongrel2 <= 1.8.0)" do
87
+ @req.headers.url_scheme = nil
88
+ @req.scheme.should == 'http'
89
+ end
90
+
91
+ it "knows that it was an SSL-encrypted request if its scheme was 'https'" do
92
+ @req.headers.url_scheme = 'https'
93
+ @req.should be_secure()
94
+ end
95
+
96
+
82
97
  describe "header convenience methods" do
83
98
 
84
99
  before( :each ) do
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.33.0
4
+ version: 0.34.0
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -36,7 +36,7 @@ cert_chain:
36
36
  YUhDS0xaZFNLai9SSHVUT3QrZ2JsUmV4OEZBaDhOZUEKY21saFhlNDZwWk5K
37
37
  Z1dLYnhaYWg4NWpJang5NWhSOHZPSStOQU01aUg5a09xSzEzRHJ4YWNUS1Bo
38
38
  cWo1UGp3RgotLS0tLUVORCBDRVJUSUZJQ0FURS0tLS0tCg==
39
- date: 2012-10-03 00:00:00.000000000 Z
39
+ date: 2012-10-17 00:00:00.000000000 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: nokogiri
metadata.gz.sig CHANGED
Binary file