Clone of tempurl middleware in swift, optimized for use with cname and domain remap middleware.