Class: ShopifyClient::Client::NormalisePath

Inherits:
Faraday::Middleware
  • Object
show all
Defined in:
lib/shopify-client/client/normalise_path.rb

Instance Method Summary collapse

Instance Method Details

#on_request(env) ⇒ Object

Parameters:

  • env (Faraday::Env)


7
8
9
10
11
# File 'lib/shopify-client/client/normalise_path.rb', line 7

def on_request(env)
  unless env[:url].path.end_with?('.json')
    env[:url].path += '.json'
  end
end