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

Escaping special characters in <UniformResourceIdentifier> #83

Open
ivh opened this issue Jan 29, 2012 · 3 comments
Open

Escaping special characters in <UniformResourceIdentifier> #83

ivh opened this issue Jan 29, 2012 · 3 comments

Comments

@ivh
Copy link
Member

ivh commented Jan 29, 2012

The escape() method replaces obviously bad characters such as '<' with '%3E' etc, but does not escape the '%' character itself for some reason. This means that clauses such as
MoleculeInchikey LIKE "XLYOFNOQVPJJNP%"
get escaped to
MoleculeInchikey%20LIKE%20%22XLYOFNOQVPJJNP%%22
which doesn't validate ("... not a valid value for 'anyURI'").
Do we need to escape the % character manually?

(submitted by C.Hill)

@guyrixon
Copy link
Member

Where in the node software does this escaping happen? Is it in the query validation, or when writing the capabilities?

@ivh
Copy link
Member Author

ivh commented Jan 29, 2012

In the self-describing Source if I understand it correctly, the validation of the URL-element.

@ivh
Copy link
Member Author

ivh commented Jan 30, 2012

I just thought a few minutes about this and it seems a little tricky: We cannot just escape all %-signs since many clients (like wget) already transform things like "AtomSymbol like 'U%'" into AtomSymbol%20like%20'U%25' so escaping the % in %XX once more will be bad.

In principle, I guess, the clients should encode these things before sending and it will validate in this case. Any suggestions on how to catch the cases where the % is an unescaped percent-sign? A regexp on LIKE comes to mind but there might be a better way.

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

No branches or pull requests

2 participants