Skip to content

Commit

Permalink
Documentation.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Jan 21, 2025
1 parent 7944f8a commit c4189aa
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
4 changes: 3 additions & 1 deletion lib/protocol/http/header/accept.rb
Original file line number Diff line number Diff line change
Expand Up @@ -73,10 +73,12 @@ def split(*args)
end
end

# Parse the `accept` header value into a list of content types.
#
# @parameter value [String] the value of the header.
def initialize(value = nil)
if value
super(value.scan(SEPARATOR).map(&:strip))
else
end
end

Expand Down
4 changes: 2 additions & 2 deletions lib/protocol/http/header/quoted_string.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,9 @@ module Header
# https://tools.ietf.org/html/rfc7231#section-5.3.1
QVALUE = /0(\.[0-9]{0,3})?|1(\.[0]{0,3})?/

# Handling of HTTP quoted strings.
module QuotedString
# Unquote a "quoted-string" value according to https://tools.ietf.org/html/rfc7230#section-3.2.6
# It should already match the QUOTED_STRING pattern above by the parser.
# Unquote a "quoted-string" value according to <https://tools.ietf.org/html/rfc7230#section-3.2.6>. It should already match the QUOTED_STRING pattern above by the parser.
def self.unquote(value, normalize_whitespace = true)
value = value[1...-1]

Expand Down

0 comments on commit c4189aa

Please sign in to comment.