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

Verbatim links need to URL escape parameters #780

Closed
mdoering opened this issue Dec 14, 2020 · 6 comments
Closed

Verbatim links need to URL escape parameters #780

mdoering opened this issue Dec 14, 2020 · 6 comments
Labels

Comments

@mdoering
Copy link
Member

The Å in the URL parameters breaks the application. It needs to be URL encoded:

https://data.catalogueoflife.org/dataset/1141/verbatim?type=col:Taxon&type=col:Synonym&type=col:Description&type=col:Media&type=col:Distribution&type=col:VernacularName&col:parentID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20Å&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20Å&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20Å&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20Å&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20Å&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20Å&termOp=OR

linked from the taxon details page and verbatim pages, e.g. here:
https://data.catalogueoflife.org/dataset/1141/verbatim?col%3AparentID=Asterales-Asteraceae-Cichorioideae-Taraxacum&col%3AtaxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum&col%3AtaxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum&col%3AtaxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum&col%3AtaxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum&col%3AtaxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum&q=Kirschner&termOp=OR&type=col%3ATaxon&type=col%3ASynonym

https://data.catalogueoflife.org/dataset/1141/taxon/Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20%26%20Å

@mdoering mdoering added the bug label Dec 14, 2020
@mdoering mdoering changed the title Verbatim links illegal URLs Verbatim links need to URL escape parameters Dec 14, 2020
@thomasstjerne
Copy link
Contributor

The Å in the URL parameters breaks the application. It needs to be URL encoded:

The Å doesn´t break anything, this one works just fine: https://data.catalogueoflife.org/dataset/1141/taxon/Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20%26%20Å

It is the & surrounded by spaces that breaks the structure of the query parameters.
We should discuss whether it makes sense to spend a lot of time on writing custom url parsers etc in order to insist on having really strange IDs

@mdoering
Copy link
Member Author

clearly no custom url parser. But should we not URL encode every ID in the path so this does not happen? I would expect the application to URL encode all IDs used in the path or parameter, so we would have this in the case above:

https://data.catalogueoflife.org/dataset/1141/taxon/Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20%26%20%C3%85

thomasstjerne added a commit that referenced this issue Dec 16, 2020
@thomasstjerne
Copy link
Contributor

Now, parameters are encoded. But still, this is what query-string :

{
  " Å": [
    null,
    null,
    null,
    null,
    null,
    null
  ],
  "col:parentID": "Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner ",
  "col:taxonID": [
    "Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner ",
    "Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner ",
    "Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner ",
    "Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner ",
    "Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner "
  ],
  "termOp": "OR",
  "type": [
    "col:Taxon",
    "col:Synonym",
    "col:Description",
    "col:Media",
    "col:Distribution",
    "col:VernacularName"
  ],
  "limit": 10
}

makes out of

/dataset/1141/verbatim?type=col:Taxon&type=col:Synonym&type=col:Description&type=col:Media&type=col:Distribution&type=col:VernacularName&col:parentID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20%C3%85&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20%C3%85&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20%C3%85&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20%C3%85&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20%C3%85&col:taxonID=Asterales-Asteraceae-Cichorioideae-Taraxacum-abalienatum-Kirschner%20&%20%C3%85&termOp=OR

I guess it decodes before splitting parameters by the &.
Afraid that the application uses query-string all over 😱

@thomasstjerne
Copy link
Contributor

@mdoering
Copy link
Member Author

Puzzling. I still get errors for links from Kirschner & Štepánek:
https://data.catalogueoflife.org/dataset/1141/verbatim?q=kirschner&type=col%3AName&type=col%3ATaxon&type=col%3ASynonym

thomasstjerne added a commit that referenced this issue Dec 18, 2020
@thomasstjerne
Copy link
Contributor

I could not reproduce that locally, but have just pushed sth that might fix it - but it is guessing though ;-)

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

No branches or pull requests

2 participants