Prestashop endpoint anomaly

Describe the issue/error/question

Hello, I am using the REST endpoint of Prestashop, here the docs
If I run the endpoint in the browser it’s working fine, but on n8n side, it return me a 302 error.
Do you have any ideas?

What is the error message (if any)?

{"status":"rejected","reason":{"message":"302 - \"\"","name":"Error","stack":"Error: 302 - \"\"\n    at createError (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/createError.js:16:15)\n    at settle (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/core/settle.js:17:12)\n    at IncomingMessage.handleStreamEnd (/usr/local/lib/node_modules/n8n/node_modules/axios/lib/adapters/http.js:269:11)\n    at IncomingMessage.emit (node:events:525:35)\n    at IncomingMessage.emit (node:domain:552:15)\n    at endReadableNT (node:internal/streams/readable:1358:12)\n    at processTicksAndRejections (node:internal/process/task_queues:83:21)"}}

Please share the workflow

Share the output returned by the last node

Information on your n8n setup

  • n8n version: 0.218
  • Database you’re using (default: SQLite):
  • Running n8n with the execution process [own(default), main]:
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]:

Hey @Gabriele_Bracciali,

Can you enable redirects in the HTTP Request node and let me know if that helps. A 302 response typically means the server is asking the client (in this case n8n) to use a different URL and the client will automatically follow it so normally you won’t notice this sort of thing from curl or a browser.

Hi @Jon , oh great solution, working now.
just need to enable redirects.
Thank you!

1 Like

Hey @Jon Sorry for bothering you again :sweat_smile:
The redirect stuff is good, just a quick question.

I have a concern about the response i obtain:

Like the screenshot show, i am receiving a Cloudflare HTML login page , do you think is something that can be avoid with n8n request or it’s a problem on the prestashop side(?)

Thank you!

I guess the first thing I would check is if using a different user-agent header to see if that solves anything if you control the store and cloudflare settings you could possibly just add n8n to your allowlist so it skips the check.

I’ve added:
user-agent
n8n

but same response

What about something longer like n8n-automation? It can be tricky to know what Cloudflare are putting the page up for it could be too many requests from an IP. Is it actually the login page as well or is it another page and the title tag is just misleading?

Tried with n8n-automation, same response.
it’s the login page

btw, I am speaking also with the our internal team that manage Cloudflare, maybe it’s something about rules

Hey @Gabriele_Bracciali,

It will be the rules, I would go with the earlier plan and ask them to add your n8n instances IP to the allow list.

1 Like

okay okay, thank you, always helpful, really appreciate it! :grinning:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.