From 9a3259396494b544c47c8f5fab146382f33075ad Mon Sep 17 00:00:00 2001 From: Julik Tarkhanov Date: Sat, 27 Feb 2016 18:32:18 +0100 Subject: [PATCH] Set a more explicit SERVER_SOFTWARE Rack variable When you need to have a switch in an infrastructure middleware (streaming, events and sockets) you might have to make runtime decisions based on the server that is being used. The Rack env header is the only way for the underlying Rack app to see which server it is being run on. Previously it would only contain the puma version string, which is insufficient. --- lib/puma/binder.rb | 2 +- lib/puma/const.rb | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/puma/binder.rb b/lib/puma/binder.rb index 6cb89091..7a4fe8c8 100644 --- a/lib/puma/binder.rb +++ b/lib/puma/binder.rb @@ -28,7 +28,7 @@ module Puma "QUERY_STRING".freeze => "", SERVER_PROTOCOL => HTTP_11, - SERVER_SOFTWARE => PUMA_VERSION, + SERVER_SOFTWARE => PUMA_SERVER_STRING, GATEWAY_INTERFACE => CGI_VER } diff --git a/lib/puma/const.rb b/lib/puma/const.rb index ae74f6d4..0aa86aff 100644 --- a/lib/puma/const.rb +++ b/lib/puma/const.rb @@ -101,7 +101,8 @@ module Puma PUMA_VERSION = VERSION = "3.0.2".freeze CODE_NAME = "Plethora of Penguin Pinatas".freeze - + PUMA_SERVER_STRING = ['puma', PUMA_VERSION, CODE_NAME].join(' ').freeze + FAST_TRACK_KA_TIMEOUT = 0.2 # The default number of seconds for another request within a persistent