To ensure our test is accurate we should read the actual content that is returned by our test file. If we do get the file's content we know the directory is accessible publicly.
Add additional check to our PDF tmp directory test
Instead of blindly checking for a 200 status response we also read the body of the response and see if it matches what we saved to the file. This will prevent problems with any redirects in place, and should prevent all false positives.