Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Endpoint async functions instead of URL #45

Open
ngmiduc opened this issue Mar 24, 2021 · 6 comments
Open

Endpoint async functions instead of URL #45

ngmiduc opened this issue Mar 24, 2021 · 6 comments

Comments

@ngmiduc
Copy link

ngmiduc commented Mar 24, 2021

Hi,

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

@PythonLinks
Copy link

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).

@Akash187
Copy link

@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.

@calumk
Copy link

calumk commented May 15, 2023

This is really needed

Format could be like this

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

@ngmiduc
Copy link
Author

ngmiduc commented Aug 3, 2023

@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.

@Abhii5496
Copy link

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

@IhorKirei
Copy link

Any solution for this?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants