Sha256: d4d6774e16ed0ec6f2b43f4bba44ee6ea1852cb8419980fbd19b8e5c9f6b8a18
Contents?: true
Size: 495 Bytes
Versions: 17
Compression:
Stored size: 495 Bytes
Contents
module Attune # Faraday 0.8 can't make resuests like /?ids=123&ids=456 and forces the form # /?ids[]=123&ids[]=456 (this is fixed in faraday 0.9) # # Fortunately faraday's middleware is quite powerful. This just strips the # array syntax from the request. class ParamFlattener < Faraday::Middleware def call(env) url = env[:url] # replaces ?foo[]=123 with ?foo=123 url.query = url.query.gsub('%5B%5D', '') if url.query @app.call(env) end end end
Version data entries
17 entries across 17 versions & 1 rubygems