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

BUG - deletion of links through web-ui (server-related) #2459

Closed
miromeir opened this issue Dec 25, 2024 · 4 comments
Closed

BUG - deletion of links through web-ui (server-related) #2459

miromeir opened this issue Dec 25, 2024 · 4 comments

Comments

@miromeir
Copy link

miromeir commented Dec 25, 2024

This was only tested in the web-ui, it throws an error upon deleting a link.
The reason is CORS related, probably the preflight checks of the DELETE request is being blocked.
The solution was to add

allow_methods="*"

to the cors ResourceOptions in web_server.py
Can you please check if this bug is reproducible?
if so, i'd love to submit a pull request, perhaps discuss an alternative solution.

@grossmj
Copy link
Member

grossmj commented Dec 25, 2024

I am a bit confused because allow_methods is already set with "*": https://github.com/GNS3/gns3-server/blob/3.0/gns3server/api/server.py#L70

@miromeir
Copy link
Author

now I am a bit confused as well.
The code i'm referring to is on branch "master", and it uses aiohttp for the api.
Your link points to a v3.0, that has FastAPI instead.
is master not the correct branch to clone from?

@grossmj
Copy link
Member

grossmj commented Dec 27, 2024

Sorry, I thought you were talking about v3.0.

For v2, I think you must have changed this code:

https://github.com/GNS3/gns3-server/blob/master/gns3server%2Fweb%2Fweb_server.py#L314-L325

Is this correct?

@miromeir
Copy link
Author

That's correct.

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

2 participants