Fix possible issue with replacement in canonical of  http / https, props [jrfnl](https://github.com/jrfnl)