cernopendata / opendata.cern.ch

Source code for the CERN Open Data portal
http://opendata.cern.ch/
GNU General Public License v2.0
666 stars 148 forks source link

URL text case: links broken when wrong case is used #883

Closed RaoOfPhysics closed 5 years ago

RaoOfPhysics commented 8 years ago

Shouldn't the URLs be case-insensitive? Currently, for example:

suenjedt commented 8 years ago

Yes, that should not be the case. Thanks for spotting!

ghost commented 8 years ago

Two methods to do it but it is not recommended as it creates multiple entries for the search engine.

import re from werkzeug.routing import Rule, RequestRedirect

class CIRule(Rule): def compile(self): Rule.compile(self) self._regex = re.compile(self._regex.pattern, re.UNICODE | re.IGNORECASE)

from flask import Flask

class CIFlask(Flask): url_rule_class = CIRule

via: http://librelist.com/browser/flask/2011/6/24/case-insensitive-routing/#198dd20c7198760b3e2f5d5ada19b7f9

heitorPB commented 5 years ago
* http://opendata.cern.ch/about/CMS-Physics-Objects works, but

* http://opendata.cern.ch/about/CMS-physics-objects is broken!

Those 2 links points to the same page and some others I checked are case insenstive. I guess this was fixed?

tiborsimko commented 5 years ago

@heitorPB Thanks, yes, we had fixed it in the meantime.