mitmproxy for troubleshooting

Recently at work, we had an issue where a redirection to a certain site was failing (404) on Safari but not in any of the other major browsers. While Safari doesn’t have as robust a developer tool as Chrome, it still shows Network calls but not with sufficient details. In fact, it looks like it consolidates the 3XX redirects into a single request.

This was a good time to pull out mitmproxy. I hadn’t used it in a while and had to look up how to configure the browser to use mitmproxy again.

The next step was to intercept the requests for the particular domain and sure enough the problem was revealed. There was a tab character that was being appended to the end of the URL and Safari seemed to be encoding that and trying to visit the URL which resulted in the 404. Other browsers just ignored the trailing white space and continued on.