examples: Fix crash if port is not in request URI