link icon indicating copy to clipboard operation
link copied to clipboard

Endpoint async functions instead of URL

Open ngmiduc opened this issue 3 years ago • 5 comments

Hi,

is it also possible to put an async function as the endpoint instead of haveing a URL ?

ngmiduc avatar Mar 24 '21 09:03 ngmiduc

I think not. It has to do with CORS, cross site scriptiong. the browser does not let you access one site from another, unless the other explicitely allows it.

Having said that, what confuses me is how it accesses the image. With the fetchUrl argument, I return the image url, somehow it grabs that, but it is not allowed to do so in general. I guess I will be reading the code in greater depth, to see what magic they do, and maybe to make some upgrades.

Thanks for the brilliant work, guys in St. Petersburg (and elsewhere).

PythonLinks avatar Jan 04 '22 08:01 PythonLinks

@PythonLinks you missed the point that @ngmiduc is trying to make. Actually, he wants to manage making request on his own. Similar to Image plugin. Currently, I am facing an issue where I have my auth token stored in cookies. Which automatically gets sent to the backend with every request that I make using Axios. Since cookies are protected by HTTP: only I can't access them with javascript and set it on headers.

Akash187 avatar May 27 '22 22:05 Akash187

This is really needed

Format could be like this

LinkTool : {
    class : LinkTool,
    config : {
        endpointAsync  = (url) => {
               return // some function that somes something with url
        }
    }
}

calumk avatar May 15 '23 17:05 calumk

@PythonLinks you missed the point that @ngmiduc is trying to make. Actually, he wants to manage making request on his own. Similar to Image plugin. Currently, I am facing an issue where I have my auth token stored in cookies. Which automatically gets sent to the backend with every request that I make using Axios. Since cookies are protected by HTTP: only I can't access them with javascript and set it on headers.

Yes sorry for the unclear issue. Yes, I wanted to manage the request by my own.

ngmiduc avatar Aug 03 '23 12:08 ngmiduc

This is really needed

Format could be like this

LinkTool : {
    class : LinkTool,
    config : {
        endpointAsync  = (url) => {
               return // some function that somes something with url
        }
    }
}

i have the same issue , this would be great if we just get the url do whatever we want with it

Abhii5496 avatar Apr 03 '24 07:04 Abhii5496