semanticize / semanticizer

Entity Linking for the masses
http://semanticize.uva.nl/
GNU General Public License v3.0
56 stars 15 forks source link

Multiple slashes are not squashed into one #21

Closed larsmans closed 10 years ago

larsmans commented 10 years ago

Try

curl http://semanticize.uva.nl/api//nl?text=Semanticize+me

This breaks because of the //. Do we want to handle this on the semanticizer side?

dodijk commented 10 years ago

Is this even a valid URL?

Op 11 nov. 2013, om 18:34 heeft Lars Buitinck notifications@github.com het volgende geschreven:

Try

curl http://semanticize.uva.nl/api//nl?text=Semanticize+me This breaks because of the //. Do we want to handle this on the semanticizer side?

— Reply to this email directly or view it on GitHub.

larsmans commented 10 years ago

It's valid, just not very pretty. It's up to the application to interpret the path, viz. to decide that two ore more consecutive slashes are equivalent to a single one.

dodijk commented 10 years ago

For me, it’s not worth spending any effort on fixing these ugly URLs. Did you come across a request like this 'in the wild’?

Op 11 nov. 2013, om 19:29 heeft Lars Buitinck notifications@github.com het volgende geschreven:

It's valid, just not very pretty. It's up to the application to interpret the path, viz. to decide that two ore more consecutive slashes are equivalent to a single one.

— Reply to this email directly or view it on GitHub.

larsmans commented 10 years ago

Yes, I just inadvertently generated one and spent quite some time debugging because of it. Other web services, such as Elasticsearch, treat double slashes as if they were single ones so I never cared to generate pretty URLs until just now.

dodijk commented 10 years ago

It seems to be by design in Flask: https://github.com/mitsuhiko/flask/issues/663.

Should be that hard to come up with a more fancy pattern for the URLs, though.

Op 11 nov. 2013, om 19:34 heeft Lars Buitinck notifications@github.com het volgende geschreven:

Yes, I just inadvertently generated one and spent quite some time debugging because of it. Other web services, such as Elasticsearch, treat double slashes as if they were single ones so I never cared to generate pretty URLs until just now.

— Reply to this email directly or view it on GitHub.

larsmans commented 10 years ago

Aha. It's not really a necessity, but if there's a quick and easy way to be more liberal in what to accept than that would be nice. For now, I'll be more conservative in what I produce.

dodijk commented 10 years ago

I agree it would be better to be robust. However, I didn’t see any quick solution for this other than diving into the Flask or Werkzeug code, so I’m not pursuing this further.

Op 11 nov. 2013, om 23:59 heeft Lars Buitinck notifications@github.com het volgende geschreven:

Aha. It's not really a necessity, but if there's a quick and easy way to be more liberal in what to accept than that would be nice. For now, I'll be more conservative in what I produce.

— Reply to this email directly or view it on GitHub.

dodijk commented 10 years ago

Again no easy fix found. I'm closing the ticket.