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

forward slashes cause problems #233

Closed
IsomerDesign opened this issue Nov 12, 2023 · 2 comments
Closed

forward slashes cause problems #233

IsomerDesign opened this issue Nov 12, 2023 · 2 comments

Comments

@IsomerDesign
Copy link

This works: 4-tert-butyl
This causes problems: 4-/tert-butyl

This is an "innocent mistake". I use / in my names as markup for "put the next token in italic font." I'm not aware of any use of / in IUPAC names, so in that sense it's not a problem. Still, it would probably be wise to filter it or escape it to avoid 404 errors under the hood.

@dan2097
Copy link
Owner

dan2097 commented Dec 3, 2023

If I recall the 404 errors are due to an issue with how the chemistry department's web server handles requests containing this character. Specifically for "security" reasons they're not allowed even when correctly escaped in a request.
i.e. OPSIN doesn't even recieve the request if it contains a forward slash hence giving the 404.

I'm not currently sure of the best approach to resolving this. I could (and probably should) add support for POST requests which would be uneffected by this, but this doesn't really help with the problem when OPSIN is used to produce images directly from names as ideally that does require a URL e.g. https://opsin.ch.cam.ac.uk/opsin/<name>.png

If I recall forward slashes are legitimately allowed by OPSIN in only two places (R/S) and (+/-) and in both cases the / is optional.
As I'm not sure that format is common I don't think it makes sense to support it directly in OPSIN.

As a pragmatic workaround I've changed opsin.ch.cam.ac.uk to strip forward slashes from the names submitted to it.

@IsomerDesign
Copy link
Author

That seems a reasonable solution to me. Thank you.

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