trim origin before adding it to cors