factor out redirect following code (fixes #31)
factor out redirect following code (fixes #31)

lgarron/httpswatch,HTTPSWatchAU/httpswatch,kyhwana/httpswatch,gutworth/httpswatch,HTTPSWatchAU/httpswatch,gutworth/httpswatch,benjaminp/httpswatch,kyhwana/httpswatch,benjaminp/httpswatch