Skip to content

Commit 0dee5f7

Browse files
committed
Fix Rack response for Puma webserver
* Rack expects an enumerable. An empty string doesn't work (it worked for Thin, though).
1 parent 25b96e4 commit 0dee5f7

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

lib/cloud_controller/metrics_webserver.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@ module VCAP
55
module CloudController
66
class MetricsWebserver
77
attr_reader :app
8-
@server
98

109
def initialize
1110
@app = build_app

middleware/cors.rb

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,8 @@ def call(env)
3333
})
3434
end
3535

36-
return [200, preflight_headers, ''] if env['REQUEST_METHOD'] == 'OPTIONS'
36+
# NOTE: The response body must be an enumerable for Puma. Returning an empty string does not work.
37+
return [200, preflight_headers, ['']] if env['REQUEST_METHOD'] == 'OPTIONS'
3738

3839
status, headers, body = call_app(env)
3940

0 commit comments

Comments
 (0)