Class: Drillbit::Responses::InvalidSubdomain

Inherits:
Object
  • Object
show all
Defined in:
lib/drillbit/responses/invalid_subdomain.rb

Class Method Summary collapse

Class Method Details

.call(env) ⇒ Object

rubocop:disable Style/InlineComment



9
10
11
12
13
14
15
16
17
# File 'lib/drillbit/responses/invalid_subdomain.rb', line 9

def self.call(env)
  error = Drillbit::Errors::InvalidSubdomain.new(http_host: env['HTTP_HOST'])

  [
    error.http_status,                    # HTTP Status Code
    {},                                   # Response Headers
    ["{\"errors\": [#{error.to_json}]}"], # Message
  ]
end