Method: Bundler::URI::HTTP#origin
- Defined in:
- lib/bundler/vendor/uri/lib/uri/http.rb
#origin ⇒ Object
Description
Returns the origin for an HTTP uri, as defined in www.rfc-editor.org/rfc/rfc6454.
Example:
Bundler::URI::HTTP.build(host: 'www.example.com', path: '/foo/bar').origin #=> "http://www.example.com"
Bundler::URI::HTTP.build(host: 'www.example.com', port: 8000, path: '/foo/bar').origin #=> "http://www.example.com:8000"
Bundler::URI::HTTP.build(host: 'www.example.com', port: 80, path: '/foo/bar').origin #=> "http://www.example.com"
Bundler::URI::HTTPS.build(host: 'www.example.com', path: '/foo/bar').origin #=> "https://www.example.com"
119 120 121 |
# File 'lib/bundler/vendor/uri/lib/uri/http.rb', line 119 def origin "#{scheme}://#{authority}" end |