Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
pull_request:
branches: [main]

permissions:
contents: read

jobs:
lint:
runs-on: ubuntu-latest
Expand Down
4 changes: 2 additions & 2 deletions lib/mpp/parsing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ module Parsing
MAX_HEADER_PAYLOAD_SIZE = T.let(16 * 1024, Integer)

# RFC 9110 auth-param regex: key="value" or key=token
AUTH_PARAM_RE = /([a-zA-Z_][\w-]*)\s*=\s*(?:"((?:[^"\\]|\\.)*)"|([^\s,]+))/
AUTH_PARAM_RE = /([a-zA-Z_][\w-]*+)\s*=\s*(?:"((?:[^"\\]|\\.)*)"|([^\s,]++))/

module_function

Expand Down Expand Up @@ -43,7 +43,7 @@ def b64_decode(encoded)
def escape_quoted(str)
Kernel.raise Mpp::ParseError, "Header value contains invalid CRLF characters" if str.include?("\r") || str.include?("\n")

str.gsub("\\", "\\\\\\\\").gsub('"', '\\"')
str.gsub(/[\\"]/) { |c| "\\#{c}" }
end

# Unescape a quoted-string value.
Expand Down
Loading