summaryrefslogtreecommitdiff
path: root/vendor/bundle/ruby/3.4.0/gems/webrick-1.9.1/sig/httpservlet/filehandler.rbs
blob: 792fd2a8e16990cb67c065dd3e013910a79ef2b0 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
module WEBrick
  module HTTPServlet
    class DefaultFileHandler < AbstractServlet
      @local_path: String

      def initialize: (HTTPServer server, String local_path) -> void

      def do_GET: (HTTPRequest req, HTTPResponse res) -> void

      def not_modified?: (HTTPRequest req, HTTPResponse res, Time mtime, String etag) -> bool

      # returns a lambda for webrick/httpresponse.rb send_body_proc
      def multipart_body: (File body, Array[[Numeric, Numeric]] parts, String boundary, String mtype, Integer filesize) -> HTTPResponse::_CallableBody

      def make_partial_content: (HTTPRequest req, HTTPResponse res, String filename, Integer filesize) -> void

      def prepare_range: (Range[Integer] range, Integer filesize) -> [Numeric, Numeric]
    end

    class FileHandler < AbstractServlet
      @config: AbstractServlet::_Config

      @logger: Log

      @root: String

      @options: Hash[Symbol, untyped]

      HandlerTable: Hash[String, singleton(AbstractServlet)]

      def self.add_handler: (String suffix, singleton(AbstractServlet) handler) -> singleton(AbstractServlet)

      def self.remove_handler: (String suffix) -> singleton(AbstractServlet)

      def initialize: (HTTPServer server, String root, ?Hash[Symbol, untyped] options, ?Hash[Symbol, untyped] default) -> void

      def set_filesystem_encoding: (String str) -> String

      def service: (HTTPRequest req, HTTPResponse res) -> void

      def do_GET: (HTTPRequest req, HTTPResponse res) -> void

      def do_POST: (HTTPRequest req, HTTPResponse res) -> void

      def do_OPTIONS: (HTTPRequest req, HTTPResponse res) -> void

      private

      def trailing_pathsep?: (String path) -> bool

      def prevent_directory_traversal: (HTTPRequest req, HTTPResponse res) -> void

      def exec_handler: (HTTPRequest req, HTTPResponse res) -> bool

      def get_handler: (HTTPRequest req, HTTPResponse res) -> singleton(AbstractServlet)

      def set_filename: (HTTPRequest req, HTTPResponse res) -> bool

      def check_filename: (HTTPRequest req, HTTPResponse res, String name) -> void

      def shift_path_info: (HTTPRequest req, HTTPResponse res, String path_info, ?String? base) -> void

      def search_index_file: (HTTPRequest req, HTTPResponse res) -> String?

      def search_file: (HTTPRequest req, HTTPResponse res, String basename) -> String?

      def call_callback: (Symbol callback_name, HTTPRequest req, HTTPResponse res) -> void

      def windows_ambiguous_name?: (String name) -> bool

      def nondisclosure_name?: (String name) -> bool

      def set_dir_list: (HTTPRequest req, HTTPResponse res) -> void
    end
  end
end