lundi 27 septembre 2021

Validating slightly differing urls to a database

I am building an internal tool for our team, which is basically a database of urls. Within a Chrome extension I want to be able to check whether the url the user is currently on is in our database.

Checking this for the main domains is easy. The problem is that often query parameters differ slightly. For example, in a sharepoint link, the query paramter sourcedoc indicates the document ID, while the query paramter mobileredirect is not necessary, since I get on the same page with or without this parameter.

So when I parce an url, is there any standard way/algorithm to check whether parts of the url/query parameters are optional or unimportant?




Aucun commentaire:

Enregistrer un commentaire