I’m using the HTTP node to fetch an image from an S3 system. To prevent issues with accents in filenames, spaces, etc. I’m using the
encodeURIComponent function. The issue is that when I’m using either these functions on my URL field expression, I get the following error:
Whereas when I’m not using these functions, the error does not happen?
Error happens on docker and npm versions.
It looks like your topic is missing some important information. Could you provide the following if applicable.
- n8n version:
- Database (default: SQLite):
- n8n EXECUTIONS_PROCESS setting (default: own, main):
- Running n8n via (Docker, npm, n8n cloud, desktop app):
- Operating system:
encodeURIComponent wouldn’t work, as that would simply return a string that’s not a valid url.
encodeURI seems to work as expected for me.
As explained in my OP, both
encodeURIComponent do not work. The functions themselves work properly, but using the resulting encoded value renders into an error on the side of the HTTP node.
Can you please share a simple workflow where you can reproduce this issue with
encodeURI? I’m unfortunately not able to reproduce this.
encodeURIComponent will not work for this, as it’s not meant to be used to encode entire urls.
The only time one should use
encodeURIComponent on a url is if that url is supposed to be a part of query-params of another url, or in form-data.
Going back on my words, the issue doesn’t come from n8n. The minio I’m fetching files from was not giving a verbose enough error so I thought it came from the node.
The issue was with commas in filenames and my workflow not processing correctly the URL passed into the HTTP node.
This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.