Sha256: 4e18c0c2cedb4bfed9f2572ad7ae279f0e33610ceb22d77fdeb3cf5043649e29

Contents?: true

Size: 541 Bytes

Versions: 18

Compression:

Stored size: 541 Bytes

Contents

module ProconBypassMan::ProconDisplay
  class HttpResponse
    def initialize(body, status: , format: "text/json")
      @body = body&.to_json
      @status = status
      @format = format
    end

    def to_s
      <<~EOH
        HTTP/1.1 #{@status}
        Content-Length: #{@body&.bytes&.size || 0}
        Content-Type: #{@format}
        Access-Control-Allow-Origin: *
        Access-Control-Allow-Methods: GET
        Access-Control-Allow-Private-Network:true
        Connection: close

        #{@body}
      EOH
    end
  end
end

Version data entries

18 entries across 18 versions & 1 rubygems

Version Path
procon_bypass_man-0.3.12 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.11 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.10 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.9 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.8.1 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.8 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.7 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.6 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.5 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.4 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.3.1 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.3 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.2 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.1 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.3.0 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.2.3 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.2.2 lib/procon_bypass_man/procon_display/http_response.rb
procon_bypass_man-0.2.1 lib/procon_bypass_man/procon_display/http_response.rb