n8n-io / n8n

Free and source-available fair-code licensed workflow automation tool. Easily automate tasks across different services.
https://n8n.io
Other
48.44k stars 7.56k forks source link

HTTP Request node fails with quoted encodings. #11654

Open pemontto opened 2 hours ago

pemontto commented 2 hours ago

Bug Description

PR #9869 introduced a bug where HTTP responses that quote the encoding breaks the autodetected content.

n8n now tries to decode the content with the literal "utf-8" instead of utf-8.

image

Based on the RFC7231 quotes are allowed and expected:

   A parameter value that matches the token production can be
   transmitted either as a token or within a quoted-string.  The quoted
   and unquoted values are equivalent.  For example, the following
   examples are all equivalent, but the first is preferred for
   consistency:

     text/html;charset=utf-8
     text/html;charset=UTF-8
     Text/HTML;Charset="utf-8"
     text/html; charset="utf-8"

To Reproduce

Make an HTTP request with Response Format: Autodetect to a server that quotes the charset/encoding.

Expected behavior

Response is decoded with the unquoted string

Operating System

n8n docker image

n8n Version

1.51.0 to master

Node.js Version

n8n docker image

Database

SQLite (default)

Execution mode

main (default)

Joffcom commented 2 hours ago

Hey @pemontto,

We have created an internal ticket to look into this which we will be tracking as "GHC-411"