Module: Puppeteer::Bidi::HTTPUtils
- Defined in:
- lib/puppeteer/bidi/http_utils.rb,
sig/puppeteer/bidi/http_utils.rbs
Overview
Utilities for normalizing HTTP data exposed through the Puppeteer API.
Class Method Summary collapse
-
.normalize_header_value(name, value) ⇒ String
Normalize multiline HTTP header values.
Class Method Details
.normalize_header_value(name, value) ⇒ String
Normalize multiline HTTP header values.
12 13 14 15 16 17 |
# File 'lib/puppeteer/bidi/http_utils.rb', line 12 def self.normalize_header_value(name, value) return value unless value.include?("\n") separator = name == "set-cookie" ? "\n " : ", " value.split("\n").map(&:strip).reject(&:empty?).join(separator) end |