Class: Maze::Servlets::BaseServlet

Inherits:
WEBrick::HTTPServlet::AbstractServlet
  • Object
show all
Defined in:
lib/maze/servlets/base_servlet.rb

Overview

Base servlet to avoid duplication of common code

Instance Method Summary collapse

Instance Method Details

#do_OPTIONS(request, response) ⇒ Object

Logs and returns a set of valid headers for this servlet.

Parameters:

  • request (HTTPRequest)

    The incoming GET request

  • response (HTTPResponse)

    The response to return



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/maze/servlets/base_servlet.rb', line 12

def do_OPTIONS(request, response)
  response.header['Access-Control-Allow-Origin'] = '*'
  response.header['Access-Control-Allow-Headers'] = %w[
    Accept
    Bugsnag-Api-Key
    Bugsnag-Integrity
    Bugsnag-Payload-Version
    Bugsnag-Sent-At
    Bugsnag-Span-Sampling
    Bugsnag-Uncompressed-Content-Length
    Content-Type
    Origin
  ].join(',')
end