Fix handling of port in header, allow to define inline middleware.