Starting to put in the header checks for github to prevent throttling
Adding in the checks for 302 and factoring out some common code