|
@@ -15,9 +15,19 @@ class HelloWorld < Roda
|
|
|
rand(MAX_PK) + 1
|
|
|
end
|
|
|
|
|
|
+ if defined?(Puma)
|
|
|
+ def set_default_headers(response)
|
|
|
+ response[DATE_HEADER] = Time.now.httpdate
|
|
|
+ response[SERVER_HEADER] = SERVER_STRING
|
|
|
+ end
|
|
|
+ else
|
|
|
+ def set_default_headers(response)
|
|
|
+ response[SERVER_HEADER] = SERVER_STRING
|
|
|
+ end
|
|
|
+ end
|
|
|
+
|
|
|
route do |r|
|
|
|
- response[DATE_HEADER] = Time.now.httpdate
|
|
|
- response[SERVER_HEADER] = SERVER_STRING if SERVER_STRING
|
|
|
+ set_default_headers(response)
|
|
|
|
|
|
# Test type 1: JSON serialization
|
|
|
r.is "json" do
|