Docker/Helpers/src/github.com/roscopecoltran/scancode-toolkit/tests/licensedcode/data/licenses/cgi_wrapper.rb
# The header is typically called to send back the header.  In our case we
# collect it into a hash for later usage.  This can be called multiple
# times to set different cookies.
The header is typically called to send back the header.  In our case we
collect it into a hash for later usage.  This can be called multiple
times to set different cookies.
The header is typically called to send back the header . In our case we collect it into a hash for later usage . This can be called multiple times to set different cookies .
def header(options = "text/html")
    if String === options
      @head[CONTENT_TYPE] ||= options
    else
      HEADER_MAP.each_pair do |from, to|
        from = options.delete(from) or next
        @head[to] = from.to_s
      end
      @head[CONTENT_TYPE] ||= "text/html"
      if charset = options.delete(CHARSET)
        @head[CONTENT_TYPE] << "; charset=#{charset}"
      end
      if cookie = options.delete(COOKIE)
        set_cookies = @headv[SET_COOKIE]
        case cookie
        when Array
          cookie.each { |c| set_cookies << c.to_s }
        when Hash
          cookie.each_value { |c| set_cookies << c.to_s }
        else
          set_cookies << cookie.to_s
        end
      end
      @status ||= options.delete(STATUS) 
      options.delete(NPH)
      options.delete(CONNECTION)
      options.each_pair { |k,v| @headv[k] << v }
    end
    ""
  end
def header ( options = "text/html" ) if String === options @head [ CONTENT_TYPE ] ||= options else HEADER_MAP . each_pair do | from , to | from = options . delete ( from ) or next @head [ to ] = from . to_s end @head [ CONTENT_TYPE ] ||= "text/html" if charset = options . delete ( CHARSET ) @head [ CONTENT_TYPE ] << "; charset=#{charset}" end if cookie = options . delete ( COOKIE ) set_cookies = @headv [ SET_COOKIE ] case cookie when Array cookie . each { | c | set_cookies << c . to_s } when Hash cookie . each_value { | c | set_cookies << c . to_s } else set_cookies << cookie . to_s end end @status ||= options . delete ( STATUS ) options . delete ( NPH ) options . delete ( CONNECTION ) options . each_pair { | k , v | @headv [ k ] << v } end "" end
The header is typically called to send back the header.
The header is typically called to send back the header .
# if they pass in a string then just write the Content-Type # lots of ways to set cookies # all lower-case # drop the keys we don't want anymore # finally, set the rest of the headers as-is, allowing duplicates # doing this fakes out the cgi library to think the headers are empty # we then do the real headers in the out function call later
options
<not_specific>