Skip to content

Wrong parsing of HTTP trailer headers #942

@Alkarex

Description

@Alkarex

Some feeds are not parsed correctly due to wrong handling of HTTP trailer headers such as Server-Timing.

Example of feed:
https://www.caranddriver.com/rss/all.xml
(Note that the bug may or may not exhibit itself depending on the cURL and PHP versions)

Downstream discussion:

SimplePie tries to XML parse something like </rss>server-timing: rtt; dur=6.131, retrans; dur=0, trailer-timestamp; dur=1758222994925 which obviously fails.

In the case of normal HTTP transfer (not chunked), we need to use content-length to know where the body stops, but content-length is wrong if any compression was used.
So I believe we should let cURL perform the separation of HTTP headers and body instead of using the SimplePie parser.

I have a downstream fix for FreshRSS. Let me know if you are interested in such an approach for an upstream PR:

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions