This code seems to depend on .split('://') returning a 2-element sequence. This doesn't seem to be a valid assumption:
The baseUri property's value MUST conform to the URI specification [RFC2396] or a Level 1 Template URI as defined in RFC 6570
From my reading of RFC 6570, it seems stuff like: {endpoint}/api, where endpoint is something like http://foo, would be completely valid--or at least that isn't explicitly prohibited.
With such a baseUri, the current code would end up attempting a str + list concatenation, which is a TypeError.
I'm not sure of the best way to handle this--I also think logic like "if no uri scheme is present in the un-expanded template uri, the rest of this code will be invalid anyway, so just return uri" would be also valid.
Would you like a regression test for this as well?
This code seems to depend on
.split('://')
returning a 2-element sequence. This doesn't seem to be a valid assumption:From my reading of RFC 6570, it seems stuff like:
{endpoint}/api
, whereendpoint
is something likehttp://foo
, would be completely valid--or at least that isn't explicitly prohibited.With such a baseUri, the current code would end up attempting a
str + list
concatenation, which is aTypeError
.I'm not sure of the best way to handle this--I also think logic like "if no uri scheme is present in the un-expanded template uri, the rest of this code will be invalid anyway, so just return uri" would be also valid.
Would you like a regression test for this as well?