Fixed redirect with authorization issue (#450, #860)

Don't know if this was suggested also by someone else, but this commit simply removes the `authorization` header when the request needs to be redirected.

Also added `.idea` files to `.gitignore`.