lib/qa/authorities/assign_fast/generic_authority.rb in qa-0.10.2 vs lib/qa/authorities/assign_fast/generic_authority.rb in qa-0.11.0
- old
+ new
@@ -8,9 +8,19 @@
@subauthority = subauthority
end
include WebServiceBase
+ require 'qa/authorities/assign_fast/space_fix_encoder'
+ # FAST requires spaces to be encoded as %20 and will not accept + which is Faraday's default encoding
+ def response(url)
+ space_fix_encoder = AssignFast::SpaceFixEncoder.new
+ Faraday.get(url) do |req|
+ req.options.params_encoder = space_fix_encoder
+ req.headers['Accept'] = 'application/json'
+ end
+ end
+
# Search the FAST api
#
# @param [String] the query
# @return json results
def search(q)