[ruby-cvs:73553] normal:r66452 (trunk): webrick: add the ability to override res, req creation

normal at ruby-lang.org normal at ruby-lang.org
Wed Dec 19 20:08:05 JST 2018


normal	2018-12-19 20:08:05 +0900 (Wed, 19 Dec 2018)

  New Revision: 66452

  https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=66452

  Log:
    webrick: add the ability to override res, req creation
    
    So that a customized HTTPServer subclass can use it's own
    Request/Response classes.
    
    To apply the override, make a subclass of WEBrick::HTTPServer
    and override the
    `create_request_and_response(with_webrick_config)` method. The
    method should return an Array of [request, response].
    
    To check whether the Server supports this method (i.e. when
    using older versions of WEBrick when needing this
    functionality), you can ask the server if it responds to the
    method
    
        server.respond_to?(:create_request_and_response)
    
    This is backportable.
    
    [ruby-core:69604] [Feature #11266]
    
    From: Julik Tarkhanov <me at julik.nl>

  Modified files:
    trunk/lib/webrick/httpserver.rb
    trunk/test/webrick/test_httpserver.rb


More information about the ruby-cvs mailing list