Class: Foobara::CommandConnectors::Http::Commands::GetOptions
Overview
TODO: this is a bit of a hack, just a total no-op... shouldn't really need this command at all ideally
Constant Summary
TruncatedInspect::MAX_LENGTH
Instance Method Summary
collapse
install!
#inspect, truncating
foobara_class_methods_module_for, foobara_concern?, included
Instance Method Details
#execute ⇒ Object
12
13
14
15
16
17
18
19
20
21
|
# File 'src/http/commands/get_options.rb', line 12
def execute
set_allow_methods
set_access_control_max_age
""
end
|
23
24
25
|
# File 'src/http/commands/get_options.rb', line 23
def
request. ||= {}
end
|
#set_access_control_max_age ⇒ Object
44
45
46
47
48
49
|
# File 'src/http/commands/get_options.rb', line 44
def set_access_control_max_age
access_control_max_age = ENV.fetch("FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_MAX_AGE", nil)
if access_control_max_age
request.["access-control-max-age"] = access_control_max_age
end
end
|
34
35
36
37
38
39
40
41
42
|
# File 'src/http/commands/get_options.rb', line 34
def
= ENV.fetch("FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_HEADERS", nil)
if
if == "*"
= request.["access-control-request-headers"]
end
request.["access-control-allow-headers"] =
end
end
|
#set_allow_methods ⇒ Object
27
28
29
30
31
32
|
# File 'src/http/commands/get_options.rb', line 27
def set_allow_methods
allow_methods = ENV.fetch("FOOBARA_HTTP_RESPONSE_HEADER_ACCESS_CONTROL_ALLOW_METHODS", nil)
if allow_methods
request.["access-control-allow-methods"] = allow_methods
end
end
|