Fixed issue with protocol detection when running in express