-
Notifications
You must be signed in to change notification settings - Fork 35
Open
Labels
Description
When we get a postcode from a user it can take some different forms:
- With or without space
- Caps or no caps
- Any combination of the above
This is a problem in a few ways:
- The postcode result pages uses the user-entered variation of the postcode in the UK. e.g, URLs with and without spaces both work
- The logging client accepts the user entered postcode
This causes downstream problems with caching and querying logs. Not having a canonical URL for a postcode might cause undercounts in analytics.
In both of these case we validate that the postcode is valid before showing a URL or logging it, but we don't normalise it.
In other projects we have a Postcode class that can normalise user-provided data into a single form.
We should implement that here (or add that class to DC utils) and convert string postcodes to that early on in the process. We can then use a Postcode class for URLs, logging, etc.
Reactions are currently unavailable