PDF Url with space

I have a webhook that send me a pdf url with space. For sample: "DOCUMENTLINK": "Http://saddss/temp/Declaracao de Filiacao - XXXX YYYY 06_12_23.PDF". I am putting an embed with the url as: {{=encodeURI({{documento}})=}} But it doesn´t work. I also tried create a new var as below without success: const documentoEncode = encodeURI({{documento}}) return documentoEncode
6 Replies
Baptiste
Baptiste17mo ago
LuizAlves
LuizAlvesOP17mo ago
Hi, thank you @Baptiste. I find my problem. The pdf link returned from webhook is something as: 'http://xxxx pdf' , but the server redirect to 'https:// xxxx pdf' If I copy and past 'http://xxxx pdf' and put it into chrome browser, it redirects to 'htpps ://xxxx pdf' and all works well. But, if I put t http://xxxx pdf into a embed block, It doesn´t show the pdf because It´s not redirected to 'https....'. Is there something I can do to fix it?
Baptiste
Baptiste17mo ago
Just to be sure, can the pdf file be embedded? Have you tried to put the https URL directly into the embed bubble and it works?
LuizAlves
LuizAlvesOP17mo ago
If I put the https://xxx directly it works, but not htpp://xxx
Baptiste
Baptiste17mo ago
Ok you could add a Set variable block that replace http:// with https:// {{URL}}.replace('http://', 'https://')
LuizAlves
LuizAlvesOP17mo ago
Thank you. I already did it.

Did you find this page helpful?