Specify encoding for resources
Corrected authentication handling.
Corrected the URL REs to match what we really work with.