jparis / qrs-interact

Inactive - QRS Interact is a simple javascript library that allows users to send queries to the Qlik Sense Repository Service.
GNU General Public License v3.0
10 stars 7 forks source link

Generated QRS URL is invalid with double question marks in it #80

Open mountaindude opened 3 years ago

mountaindude commented 3 years ago

When used on MacOS (which has forward slashes in its file paths, just like Linux) the generated URL is invalid:

/qrs/contentlibrary/Butler%20sheet%20thumbnails/uploadfile?externalpath=/Users/goran/code/project/img/some-image.png&overwrite=true?xrfkey=9IMnxQHU53ll69vY

The ? separates the host and path from the query parameters. There should be only one ?, but here there are two. The correct result would be ...&xrefkey=...

Need to dig into why this is happening, but wanted to flag it. The source code where things go wrong is probably here: https://github.com/jparis/qrs-interact/blob/1580fb5244bd04d1d734bb053d7b5af6395d8f48/qrsInteract.js#L38

mountaindude commented 3 years ago

Seems this happens when a query parameter includes forward slashes. Forward slashes in the URL path are fine - but when for example uploading an image to a content library, and the image file name includes /, the code breaks.

jparis commented 3 years ago

Ah yeah, I tried to have some 'smart' logic in there to deal with that and automatically append... obviously breaking stuff.

mountaindude commented 3 years ago

For what it's worth, I worked around the issue by writing my own code so that I don't have to use any paths in the POST call to the QRS API. By no means a proper solution, but it solved my immediate problem.

On Thu, 24 Jun 2021 at 19:50, Jesse Paris @.***> wrote:

Ah yeah, I tried to have some 'smart' logic in there to deal with that and automatically append... obviously breaking stuff.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/jparis/qrs-interact/issues/80#issuecomment-867834559, or unsubscribe https://github.com/notifications/unsubscribe-auth/AAH3JDQX6MGIVO7ZRSVOQ7LTUNV6ZANCNFSM47HNLSBA .