sfdc_proxy 0.0.3 → 0.0.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/sfdc_proxy.rb +3 -1
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: d42da2b2480c4f99822ed11ac019ba693c55de0f
4
- data.tar.gz: a19d4692a08ad062dcb74caa03bcdd209e7a467b
3
+ metadata.gz: d30960bc983fa82486b66c22ab213982e3fb13eb
4
+ data.tar.gz: a3f93c4f8424de17b5f5457f28cf652aa656a795
5
5
  SHA512:
6
- metadata.gz: b82153ae47233aced4c39693407a92d4e99ee33393792e7c91091bfec3b0e1321c15e28c85ed43a4f40428ef9b08413cd07f3febea9fd8bb49dd4fcdc9c93b5f
7
- data.tar.gz: 258ac3f9821b837af225ed440a6f95f9b170afc4f69db2be32c5ec79374e461be676e72da4abd53a3e39a0c51f0368c7345595e7bcc72a060e24d8fff3e909dc
6
+ metadata.gz: fb4afc4bc444f157672e3ec4cd4a768d283af3fd83a80a76dde4ed1e6e1645ca7f16c7391df0490e30041559cde6c929931d90f55abe76982012e7134fdccb9b
7
+ data.tar.gz: bc20fdb04a57c221fea3dd48f3e7b1ae86223db3270926d710030c11a800504ac41bf671656d8303619c79f4713a0a61e5840bf16d07d7ec66741bab3ff85412
@@ -16,13 +16,15 @@ class SalesforceProxy < Sinatra::Base
16
16
  proxy '/*' do
17
17
  #puts request.env.to_yaml
18
18
  body = request.body.read
19
+ path = request.env['PATH_INFO'].gsub '/proxy', ''
19
20
  query_string = request.query_string
20
21
  sf_endpoint = request.env['HTTP_X_SALESFORCEPROXY_ENDPOINT'] || 'http://login.salesforce.com/services/oauth2/token'
21
22
  auth_header = request.env['HTTP_AUTHORIZATION']
22
23
  content_type = (sf_endpoint.include?('oauth2') && 'application/x-www-form-urlencoded') || 'application/json'
23
24
  http_method = request.env['REQUEST_METHOD']
25
+ endpoint = "#{sf_endpoint}#{path}#{query_string}"
24
26
  result = Faraday.send http_method.downcase do |req|
25
- req.url "#{sf_endpoint}?#{query_string}"
27
+ req.url endpoint
26
28
  req.headers["Authorization"] = auth_header if auth_header
27
29
  req.headers['Content-Type'] = content_type if content_type
28
30
  req.body = body if body
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sfdc_proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Doug Friedman
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-11-25 00:00:00.000000000 Z
11
+ date: 2013-11-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: faraday