diff options
| author | Robert | 2017-12-01 15:25:48 +0100 |
|---|---|---|
| committer | Robert | 2017-12-01 15:25:48 +0100 |
| commit | 2792336f98056f3f7df8d02a3b2da968e97bfbe1 (patch) | |
| tree | 3e5908f7b06e014549e4a2f4eb8a4636e8182648 /app/services | |
| parent | 8e80415f70e0c181643e522976b1cf8bf9f9abfd (diff) | |
| download | chouette-core-2792336f98056f3f7df8d02a3b2da968e97bfbe1.tar.bz2 | |
Hotfix for missing token in HTTPService when called from WorkbenchImportWorker
Diffstat (limited to 'app/services')
| -rw-r--r-- | app/services/http_service.rb | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/app/services/http_service.rb b/app/services/http_service.rb index d3999f293..db4441395 100644 --- a/app/services/http_service.rb +++ b/app/services/http_service.rb @@ -26,7 +26,8 @@ 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) - result = Faraday.new(url: host) do |c| + token = token || params + Faraday.new(url: host) do |c| c.headers['Authorization'] = "Token token=#{token.inspect}" if token c.request :multipart c.request :url_encoded |
