Added message to error response
Require rack >= 1.4.1 in stead of = 1.4.1
Fix typo in comment
Refactor middleware spec
Correctly handle parameters in a URL

If a URL with parameters (like http://example.org/test.pdf?x=42) is requested generating the PDF will fail because the .pdf extension is not stripped from the URL.

The regular expression for replacing the .pdf extension now correctly handles this case.
Render to different output files when URL parameters differ

Only the path of the URL is used to create a unique output file name, but different URL parameters might result in different contents so a different file name should be used.

The whole URL (including the parameters) will now be used to generate a unique file name.
Refactor render_as_pdf? method
Set secret for cookie to prevent rack warnings
Set cache_ttl to 1 to prevent caching between tests
Remove unused concat method
Move responses from Middleware to own class
Don't set the full PDF path in the session

The complete path to the PDF being rendered is being set in the session, making this path visible to the public.

Now only the PDF filename is being set in the session.
Move conditions and condition validations to own classes
Refactor call method
Move request specific code to new PhantomRequest class
Explain that query strings can be used in a URL
Log a nicer error when a timeout occurs