Spring Cleaning = Bug Fixing

04 Apr 2019

It's spring cleaning time at Downtime Monkey which, for us, means bug-fixing.

In our last post we described how we fixed an edge-case bug which showed up in rare circumstances.

Here are the details of our latest fix...

ladybug

URLs With Forced Trailing Slashes

It was brought to our attention by one of our new users that they couldn't add some URLs as monitors. The common theme was that the URLs all had trailing slashes, i.e. https://example.com/.

The other commonality was that these trailing slashes were forced. The webpage wouldn't show without the slash, instead the user was redirected to the URL with the slash.

What was the cause?

When you add a new website monitor, Downtime Monkey first checks that the URL is valid and then visits the site to check that it is up and doesn't redirect to another webpage. This prevents people adding monitors with typos and helps keep Downtime Monkey's monitoring efficient.

We also check that a new monitor isn't a duplicate. To do this we stripped trailing slashes - the logic being that http://example.com and http://example.com/ are effectively duplicate webpages.

However, this proved a little overzealous because sites with forced trailing slashes failed the redirect validation... and therefore couldn't be added as monitors.

More than an edge-case

Although websites with forced trailing slashes are not very common, there are plenty of them out there and we should have picked-up on this earlier.

Also, there is no-doubt that we would have missed this for longer if it hadn't been brought to our attention - so a big thank you to the user who let us know!

Easy Fix

As is the case with a lot of bugs: once we were aware of it, the bug was easily fixed. We simply don't strip trailing slashes as part of URL validation any more!