Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Allow overriding Connection & Server response headers.

  • Loading branch information...
commit cc4644e4df05455619e9a88b976c345bd6438f60 1 parent 04072e3
@macournoyer authored
Showing with 3 additions and 2 deletions.
  1. +1 −0  CHANGELOG
  2. +2 −2 lib/thin/response.rb
View
1  CHANGELOG
@@ -1,5 +1,6 @@
== EDGE
* Fix issue when running as another user/group without a PID file.
+ * Allow overriding Connection & Server response headers.
== 1.5.0 Knife
* Fix compilation under Ubuntu 12.04 with -Werror=format-security option.
View
4 lib/thin/response.rb
@@ -33,8 +33,8 @@ def initialize
# to be sent in the response.
def headers_output
# Set default headers
- @headers[CONNECTION] = persistent? ? KEEP_ALIVE : CLOSE
- @headers[SERVER] = Thin::SERVER
+ @headers[CONNECTION] ||= persistent? ? KEEP_ALIVE : CLOSE
+ @headers[SERVER] ||= Thin::SERVER
@headers.to_s
end

2 comments on commit cc4644e

@asaaki

This breaks because @headers (Thin::Headers) has no method [] but with the ||= operator you expect to have one.

@macournoyer

Oops! You're right. Just fixed it. Thanks!

Please sign in to comment.
Something went wrong with that request. Please try again.