aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLuc Donnet2017-12-04 15:23:33 +0100
committerGitHub2017-12-04 15:23:33 +0100
commite9b473d9edb36c32c83a8dae4bc72b22025629ac (patch)
treef633913c14117d8bf3ec4aa9d52a42eb0a265d76
parent6ec303e25dcb9a4f6d27420597dd8b7c5b1f165e (diff)
parent614db1d28c8c8b8963a286cc0ffebf81b3acc8f2 (diff)
downloadchouette-core-e9b473d9edb36c32c83a8dae4bc72b22025629ac.tar.bz2
Merge pull request #136 from af83/0000-post_to_json_hotfix_for_local_app
Hotfix API Controller < ActionController::Base
-rw-r--r--app/controllers/api/v1/netex_imports_controller.rb6
-rw-r--r--app/services/http_service.rb1
2 files changed, 4 insertions, 3 deletions
diff --git a/app/controllers/api/v1/netex_imports_controller.rb b/app/controllers/api/v1/netex_imports_controller.rb
index 8e8c48986..d86c1fcd8 100644
--- a/app/controllers/api/v1/netex_imports_controller.rb
+++ b/app/controllers/api/v1/netex_imports_controller.rb
@@ -1,9 +1,11 @@
module Api
module V1
- class NetexImportsController < ChouetteController
+ class NetexImportsController < ActionController::Base
include ControlFlow
- skip_before_action :authenticate
+
+ respond_to :json, :xml
+ layout false
def create
respond_to do | format |
diff --git a/app/services/http_service.rb b/app/services/http_service.rb
index db4441395..c0cc1c59b 100644
--- a/app/services/http_service.rb
+++ b/app/services/http_service.rb
@@ -26,7 +26,6 @@ module HTTPService extend self
# params: { netex_import: {referential_id: 13, workbench_id: 1}},
# upload: {file: [StringIO.new('howdy'), 'application/zip', 'greeting']})
def post_resource(host:, path:, token: nil, params: {}, upload: nil)
- token = token || params
Faraday.new(url: host) do |c|
c.headers['Authorization'] = "Token token=#{token.inspect}" if token
c.request :multipart