-
Notifications
You must be signed in to change notification settings - Fork 836
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
Inconsistent percent-encoding of keys #13187
Comments
Hi @rthill91, that sound's correct to me. Percent-encoding (also known as URL encoding) is necessary only in the URL. If you disagree, please describe in more detail what you're doing, what the result is, and what you find unexpected about the result. |
The only aspect of this I think is an arangodb issue is what I mentioned about opening documents from the collection view of the web interface. A document with a key containing a substring that looks like a percent-encoded value will not open correctly. |
Below function tries to decode the URL with the key not encoded first, and if it fails, it encodes the key. This test doesn't work because js\apps\system_admin\aardvark\APP\frontend\js\views\documentsView.js goToDocument: function (error, data, msg) {
if (error) {
arangoHelper.arangoError('Error', msg.errorMessage);
} else {
window.modalView.hide();
data = data.split('/');
var url;
try {
url = 'collection/' + data[0] + '/' + data[1];
decodeURI(url);
} catch (ex) {
url = 'collection/' + data[0] + '/' + encodeURIComponent(data[1]);
}
window.location.hash = url;
}
}, I'm not sure why it isn't encoded by default. |
Ah, I see. That's not right, of course.
That looks strange indeed, and I'd expect it to be unconditionally encoded, too. |
This one is even weirder: js\apps\system_admin\aardvark\APP\frontend\js\views\documentView.js: var navigateTo = $(e.target).attr('documentLink');
var test = (navigateTo.split('%').length - 1) % 3;
if (decodeURIComponent(navigateTo) !== navigateTo && test !== 0) {
navigateTo = decodeURIComponent(navigateTo);
}
if (navigateTo) {
window.App.navigate(navigateTo, {trigger: true});
} |
Should be fixed as of 3.9.0 by #14700 |
My Environment
Component, Query & Data
Affected feature:
AQL query using web interface
AQL query (if applicable):
Steps to reproduce
test_%25
)Problem:
There is inconsistent percent-encoding happening. Documents are inserted correctly as given, but on retrieval are decoded.
I first noticed this problem when searching for a document by key in the collections view. The document was found, but when I click to open it up I get a DocumentNotFoundError. Manually fixing the key encoding in the URL results in the expected document (e.g.
.../collection/collection_name/test_%2525
)Expected result:
Encoding (or lack-thereof) is consistent across insert and retrieval
The text was updated successfully, but these errors were encountered: