Set the URL binding to:
foo = http://www.google.com/
Set the Curl request to:
Now the path accessed is http://www.google.com//hello – this is often disallowed and is unlikely to be what the user intended. (If the user really intended this, they can put // on the binding or on path).
While it may seem to be a user's error, this is too common and too easy to happen. But trailing and leading '/' has a meaning, so we simply can't strip it from binding or path either.
So, when concatenating binding URL and request path:
1. If binding ends with / and path starts with /, keep only one in the resulting URI
2. If binding doesn't end with a / and path doesn't start with /, introduce one into URI
3. If URI or path explicitly has a // – do not mess with it.
This will give the behavior of "least surprise" to the user.