Sha256: b387ae222234df785998a868fc6b665a7dfa7b360604e22ebfdfc35d0f83cab1
Contents?: true
Size: 1.04 KB
Versions: 5
Compression:
Stored size: 1.04 KB
Contents
# frozen_string_literal: true module ConvenientService module Examples module Standard class RequestParams module Utils module HTTP module Request ## # TODO: Specs. # class ParsePath < ConvenientService::Command attr_reader :http_string def initialize(http_string:) @http_string = http_string end ## # - https://stackoverflow.com/a/17599778/12201472 # - https://github.com/ruby/webrick/blob/v1.7.0/lib/webrick/httprequest.rb # def call webrick_request = ::WEBrick::HTTPRequest.new(::WEBrick::Config::HTTP) webrick_request.parse(::StringIO.new(http_string)) webrick_request.path rescue ::WEBrick::HTTPStatus::BadRequest nil end end end end end end end end end
Version data entries
5 entries across 5 versions & 1 rubygems