public
Description: Phusion Passenger (mod_rails)
Homepage: http://www.modrails.com/
Clone URL: git://github.com/FooBarWidget/passenger.git
Search Repo:
Click here to lend your support to: passenger and make a donation at www.pledgie.com !
Add X-Powered-By header to HTTP requests.
Hongli Lai (Phusion) (author)
Mon Apr 07 07:35:13 -0700 2008
commit  d6ef3dd061e74fec87463bf9f303044fc335c99c
tree    bab1eb7b8331b44967a2f8d632cf7f196304acc2
parent  bf1e409e60492ac5478199a029643193f1548fd5
...
26
27
28
 
 
 
29
30
31
...
333
334
335
336
 
337
338
339
...
26
27
28
29
30
31
32
33
34
...
336
337
338
 
339
340
341
342
0
@@ -26,6 +26,9 @@
0
 
0
 ##### Configuration
0
 
0
+# Don't forget to edit Configuration.h too
0
+PACKAGE_VERSION = "0.9.6"
0
+
0
 include PlatformInfo
0
 APXS2.nil? and raise "Could not find 'apxs' or 'apxs2'."
0
 APACHE2CTL.nil? and raise "Could not find 'apachectl' or 'apache2ctl'."
0
@@ -333,7 +336,7 @@
0
   s.homepage = "http://passenger.phusion.nl/"
0
   s.summary = "Apache module for Ruby on Rails support."
0
   s.name = "passenger"
0
- s.version = "0.9.6" # Don't forget to edit Configuration.h too
0
+ s.version = PACKAGE_VERSION
0
   s.rubyforge_project = "passenger"
0
   s.author = "Phusion - http://www.phusion.nl/"
0
   s.email = "info@phusion.nl"
...
98
99
100
 
 
 
 
 
 
101
102
103
...
121
122
123
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
124
125
126
...
98
99
100
101
102
103
104
105
106
107
108
109
...
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
0
@@ -98,6 +98,12 @@
0
   CONTENT_LENGTH = 'CONTENT_LENGTH' # :nodoc:
0
   HTTP_CONTENT_LENGTH = 'HTTP_CONTENT_LENGTH' # :nodoc:
0
   
0
+ NINJA_PATCHING_LOCK = Mutex.new
0
+ @@ninja_patched_action_controller = false
0
+
0
+ File.read("#{File.dirname(__FILE__)}/../../Rakefile") =~ /^PACKAGE_VERSION = "(.*)"$/
0
+ PASSENGER_VERSION = $1
0
+
0
   # The name of the socket on which the request handler accepts
0
   # new connections. This is either a Unix socket filename, or
0
   # the name for an abstract namespace Unix socket.
0
@@ -121,6 +127,21 @@
0
     end
0
     @owner_pipe = owner_pipe
0
     @previous_signal_handlers = {}
0
+
0
+ NINJA_PATCHING_LOCK.synchronize do
0
+ if !@@ninja_patched_action_controller && defined?(::ActionController::Base) \
0
+ && ::ActionController::Base.private_method_defined?(:perform_action)
0
+ @@ninja_patched_action_controller = true
0
+ ::ActionController::Base.class_eval do
0
+ alias passenger_orig_perform_action perform_action
0
+
0
+ def perform_action(*whatever)
0
+ headers["X-Powered-By"] = "Phusion Passenger (mod_rails) #{PASSENGER_VERSION}"
0
+ passenger_orig_perform_action(*whatever)
0
+ end
0
+ end
0
+ end
0
+ end
0
   end
0
   
0
   # Clean up temporary stuff created by the request handler.

Comments

    No one has commented yet.