From 8dbe2c3ec493a2c426ab0022950ed6aa9ecc3857 Mon Sep 17 00:00:00 2001 From: Guo Xiang Tan Date: Tue, 20 Jun 2017 08:32:45 +0900 Subject: [PATCH] FIX: Incorrect way to use Excon in `DiscourseHub`. --- lib/discourse_hub.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/discourse_hub.rb b/lib/discourse_hub.rb index 0f2fb58683e..40aabdedda9 100644 --- a/lib/discourse_hub.rb +++ b/lib/discourse_hub.rb @@ -51,8 +51,9 @@ module DiscourseHub def self.collection_action(action, rel_url, params={}) JSON.parse(Excon.send(action, "#{hub_base_url}#{rel_url}", - body: params, - headers: { 'Referer' => referer, 'Accept' => accepts.join(', '), 'Content-Type' => 'application/json' } + body: URI.encode_www_form(params), + headers: { 'Referer' => referer, 'Accept' => accepts.join(', '), "Content-Type" => "application/x-www-form-urlencoded" }, + omit_default_port: true ).body) end