Correct authentication header and add JDK 8 support

I've updated the case statement to support JDK 8 with the current URL pattern, as well as adding the up-to-date authentication cookie to the header (resolves issue #2)