diff options
author | Eric Wong <normalperson@yhbt.net> | 2013-03-05 03:48:44 +0000 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2013-03-05 04:04:58 +0000 |
commit | 16c7bcebb9c0ddc1e94bd313fa460efe4884bbe0 (patch) | |
tree | bfefc963a18bb0c7b8c2cc93113b46f92ec88f09 /lib/local_openid.rb | |
parent | 8bf0815a595ee755d91ca013572dd7911844d5db (diff) | |
download | local-openid-16c7bcebb9c0ddc1e94bd313fa460efe4884bbe0.tar.gz |
use Rack::Request#base_url for server_root
Nathan Paul Simons reported the need to include the port for certain consumers. Since we don't want to blindly add the port for users on standard HTTP/HTTPS ports, we can use Rack::Request#base_url to generate the URL for us. Rack::Request#base_url is available since Rack 1.3.0
Diffstat (limited to 'lib/local_openid.rb')
-rw-r--r-- | lib/local_openid.rb | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/lib/local_openid.rb b/lib/local_openid.rb index ab342a9..0edbf37 100644 --- a/lib/local_openid.rb +++ b/lib/local_openid.rb @@ -160,11 +160,8 @@ class LocalOpenID < Sinatra::Base finalize_response(oidresp) end - # we're the provider for exactly one identity. However, we do rely on - # being proxied and being hit with an appropriate HTTP Host: header. - # Don't expect OpenID consumers to handle port != 80. def server_root - "http://#{request.host}/" + "#{request.base_url}/" end def server |