Class Sinatra::Request
In: lib/sinatra/base.rb
Parent: Rack::Request

The request object. See Rack::Request for more info: rack.rubyforge.org/doc/classes/Rack/Request.html

Methods

accept   path_info=   route   secure?  

External Aliases

ssl? -> secure?

Public Instance methods

Returns an array of acceptable media types for the response

[Source]

    # File lib/sinatra/base.rb, line 16
16:     def accept
17:       @env['HTTP_ACCEPT'].to_s.split(',').map { |a| a.split(';')[0].strip }
18:     end

[Source]

    # File lib/sinatra/base.rb, line 39
39:     def path_info=(value)
40:       @route = nil
41:       super
42:     end

[Source]

    # File lib/sinatra/base.rb, line 32
32:     def route
33:       @route ||= begin
34:         path = Rack::Utils.unescape(path_info)
35:         path.empty? ? "/" : path
36:       end
37:     end

Whether or not the web server (or a reverse proxy in front of it) is using SSL to communicate with the client.

[Source]

    # File lib/sinatra/base.rb, line 23
23:       def secure?
24:         @env['HTTPS'] == 'on' or
25:         @env['HTTP_X_FORWARDED_PROTO'] == 'https' or
26:         @env['rack.url_scheme'] == 'https'
27:       end

[Validate]