Support parse HTTP headers with multiple lines in drupal_http_request()

Created on 27 February 2024, 4 months ago

Problem/Motivation

I have a page that returns HTTP headers in multiple lines in response.
drupal_http_request() does not support parsing (processing) them, we have a PHP warning instead.

According to RFC 2616 the feature was known as "Line Folding":

HTTP/1.1 header field values can be folded onto multiple lines if the continuation line begins with a space or horizontal tab. All linear white space, including folding, has the same semantics as SP. A recipient MAY replace any linear white space with a single SP before interpreting the field value or forwarding the message downstream.

So the following two forms were equivalent:

Header: value1, value2

and

Header: value1,
        value2

Proposed resolution

According to existing functionality, we can add a function to normalize headers.

πŸ› Bug report
Status

RTBC

Version

7.0 ⚰️

Component
BaseΒ  β†’

Last updated 1 minute ago

Created by

πŸ‡ΊπŸ‡¦Ukraine tibezh

Live updates comments and jobs are added and updated live.
Sign in to follow issues

Merge Requests

Comments & Activities

Production build 0.69.0 2024