omniauth 1.1.2 → 1.1.3

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of omniauth might be problematic. Click here for more details.

data.tar.gz.sig CHANGED
Binary file
data/README.md CHANGED
@@ -2,7 +2,7 @@
2
2
  [![Gem Version](https://badge.fury.io/rb/omniauth.png)][gem]
3
3
  [![CI Build Status](https://secure.travis-ci.org/intridea/omniauth.png?branch=master)][travis]
4
4
  [![Dependency Status](https://gemnasium.com/intridea/omniauth.png?travis)][gemnasium]
5
- [![Code Climate](https://codeclimate.com/badge.png)][codeclimate]
5
+ [![Code Climate](https://codeclimate.com/github/intridea/omniauth.png)][codeclimate]
6
6
 
7
7
  [gem]: https://rubygems.org/gems/omniauth
8
8
  [travis]: http://travis-ci.org/intridea/omniauth
@@ -158,22 +158,7 @@ Constraint][pvc] with two digits of precision. For example:
158
158
  [pvc]: http://docs.rubygems.org/read/chapter/16#page74
159
159
 
160
160
  ## License
161
- Copyright (c) 2010-2013 Michael Bleigh and Intridea, Inc.
162
-
163
- Permission is hereby granted, free of charge, to any person obtaining a copy
164
- of this software and associated documentation files (the "Software"), to deal
165
- in the Software without restriction, including without limitation the rights
166
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
167
- copies of the Software, and to permit persons to whom the Software is
168
- furnished to do so, subject to the following conditions:
169
-
170
- The above copyright notice and this permission notice shall be included in
171
- all copies or substantial portions of the Software.
172
-
173
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
174
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
175
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
176
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
177
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
178
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
179
- THE SOFTWARE.
161
+ Copyright (c) 2010-2013 Michael Bleigh and Intridea, Inc. See [LICENSE][] for
162
+ details.
163
+
164
+ [license]: LICENSE.md
@@ -403,9 +403,8 @@ module OmniAuth
403
403
  else
404
404
  uri = URI.parse(request.url.gsub(/\?.*$/,''))
405
405
  uri.path = ''
406
- uri.query = nil
407
406
  #sometimes the url is actually showing http inside rails because the other layers (like nginx) have handled the ssl termination.
408
- uri.scheme = 'https' if request.ssl?
407
+ uri.scheme = 'https' if ssl?
409
408
  uri.to_s
410
409
  end
411
410
  end
@@ -466,5 +465,12 @@ module OmniAuth
466
465
  def merge_stack(stack)
467
466
  stack.inject({}){|c,h| c.merge!(h); c}
468
467
  end
468
+ def ssl?
469
+ request.env['HTTPS'] == 'on' ||
470
+ request.env['HTTP_X_FORWARDED_SSL'] == 'on' ||
471
+ request.env['HTTP_X_FORWARDED_SCHEME'] == 'https' ||
472
+ (request.env['HTTP_X_FORWARDED_PROTO'] && request.env['HTTP_X_FORWARDED_PROTO'].split(',')[0] == 'https') ||
473
+ request.env['rack.url_scheme'] == 'https'
474
+ end
469
475
  end
470
476
  end
@@ -1,3 +1,3 @@
1
1
  module OmniAuth
2
- VERSION = "1.1.2" unless defined?(OmniAuth::VERSION)
2
+ VERSION = "1.1.3" unless defined?(OmniAuth::VERSION)
3
3
  end
data/omniauth.gemspec CHANGED
@@ -8,7 +8,7 @@ Gem::Specification.new do |spec|
8
8
  spec.add_dependency 'rack'
9
9
  spec.add_development_dependency 'bundler', '~> 1.0'
10
10
  spec.authors = ['Michael Bleigh', 'Erik Michaels-Ober']
11
- spec.cert_chain = ['certs/sferik.pem']
11
+ spec.cert_chain = %w(certs/sferik.pem)
12
12
  spec.description = %q{A generalized Rack framework for multiple-provider authentication.}
13
13
  spec.email = ['michael@intridea.com', 'sferik@gmail.com']
14
14
  spec.files = %w(.yardopts LICENSE.md README.md Rakefile omniauth.gemspec)
@@ -607,6 +607,18 @@ describe OmniAuth::Strategy do
607
607
  expect(strategy.full_host).to eq('my.host.net')
608
608
  end
609
609
 
610
+ it "is based on the request if it's not a string nor a proc" do
611
+ OmniAuth.config.full_host = nil
612
+ strategy.call(make_env('/whatever', 'rack.url_scheme' => 'http', 'SERVER_NAME' => 'my.host.net', 'SERVER_PORT' => 80))
613
+ expect(strategy.full_host).to eq('http://my.host.net')
614
+ end
615
+
616
+ it "should honor HTTP_X_FORWARDED_PROTO if present" do
617
+ OmniAuth.config.full_host = nil
618
+ strategy.call(make_env('/whatever', 'HTTP_X_FORWARDED_PROTO' => 'https','rack.url_scheme' => 'http', 'SERVER_NAME' => 'my.host.net', 'SERVER_PORT' => 443))
619
+ expect(strategy.full_host).to eq('https://my.host.net')
620
+ end
621
+
610
622
  after do
611
623
  OmniAuth.config.test_mode = false
612
624
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: omniauth
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -37,7 +37,7 @@ cert_chain:
37
37
  U0xxV3ZRUnNCbHlwSGZoczZKSnVMbHlaUEdoVTNSL3YKU2YzbFZLcEJDV2dS
38
38
  cEdUdnk0NVhWcEIrNTl5MzNQSm1FdVExUFRFT1l2UXlhbzlVS01BQWFBTi83
39
39
  cVdRdGpsMApobHc9Ci0tLS0tRU5EIENFUlRJRklDQVRFLS0tLS0K
40
- date: 2013-02-08 00:00:00.000000000 Z
40
+ date: 2013-02-14 00:00:00.000000000 Z
41
41
  dependencies:
42
42
  - !ruby/object:Gem::Dependency
43
43
  name: hashie
@@ -154,3 +154,4 @@ test_files:
154
154
  - spec/omniauth/strategy_spec.rb
155
155
  - spec/omniauth_spec.rb
156
156
  - spec/spec_helper.rb
157
+ has_rdoc:
metadata.gz.sig CHANGED
Binary file