Mocking SharePoint

Highlight of my workday was debugging an issue that turned out to be nothing like what the reporter had diagnosed.

The report suggested that our system was having problems parsing URLs with colons in the pathname, suggesting perhaps an encoding issue. It wasn’t until I took a deep dive into the logs that I realised that this was a secondary characteristic of many URLs found in customers’ SharePoint installations. And many of those URLs get redirected. And SharePoint often uses relative URLs when it sends redirections. And it turned out that our systems’ redirect handler… wasn’t correctly handling relative URLs.

It all turned into a hundred line automated test to mock SharePoint and demonstrate the problem… followed by a tiny two-line fix to the actual code. And probably the most-satisfying part of my workday!

2 comments

  1. ra-φ ra-φ says:

    I was going to comment that relative URLs in Location headers were not valid anyway but it turns out the spec had been updated 10+ years ago to allow for them. So you prompted me to learn something new today. Yay!

    1. Dan Q Dan Q says:

      I learned this too! My very first thought was “well that’s a SharePoint problem: the RFC says you can’t do that!” But yeah, it turns you that you can, now (and probably could in practice for longer: the browsers were ahead of the standards on this one).

Reply here

Your email address will not be published. Required fields are marked *

Reply on your own site

Reply elsewhere

You can reply to this post on Mastodon (@dan@danq.me), Mastodon (@blog@danq.me).

Reply by email

I'd love to hear what you think. Send an email to b28054@danq.me; be sure to let me know if you're happy for your comment to appear on the Web!