Module: Rack::PactBroker::RequestTarget
- Extended by:
- RequestTarget
- Included in:
- RequestTarget, UIRequestFilter
- Defined in:
- lib/rack/pact_broker/request_target.rb
Constant Summary collapse
- WEB_ASSET_EXTENSIONS =
%w[.js .woff .woff2 .css .png .html .map .ttf .ico].freeze
- API_CONTENT_TYPES =
%w[application/hal+json application/json text/csv application/yaml text/plain].freeze
Instance Method Summary collapse
Instance Method Details
#request_for_api?(env) ⇒ Boolean
15 16 17 |
# File 'lib/rack/pact_broker/request_target.rb', line 15 def request_for_api?(env) explicit_request_for_api(env) || no_accept_header(env) || (accept_all(env) && !is_web_extension(env)) end |
#request_for_ui?(env) ⇒ Boolean
11 12 13 |
# File 'lib/rack/pact_broker/request_target.rb', line 11 def request_for_ui?(env) !(request_for_api?(env)) end |