You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Pulp should produce paths that behave correctly with urljoin, and we've had problems in the past with developers making "relative paths" that have a leading slash.
Relative paths with leading slashes are just one demonstration of how the behavior is different. Here is another where string addition would produce an incorrect result:
Pulp should produce paths that behave correctly with urljoin, and we've had problems in the past with developers making "relative paths" that have a leading slash.
By using urljoin to handle the hrefs returned by Pulp, we'll be testing that the hrefs are correctly formed. Out of the points made above, this one makes the most sense to me. 👍
The parse.urljoin() was updated to use the RFC 3986 semantics for the resolution of relative URLs, rather than RFC 1808 and RFC 2396. (Contributed by Demian Brecht and Senthil Kumaran in issue 22118.)
Many places in the tests combine URLs and paths with simple string addition. This has the potential to produce incorrect results.
Pure addition of path parts is dangerous, because standard "urljoin" logic, which follows rules in various RFCs, behaves differently. For example:
Pulp should produce paths that behave correctly with urljoin, and we've had problems in the past with developers making "relative paths" that have a leading slash.
Relative paths with leading slashes are just one demonstration of how the behavior is different. Here is another where string addition would produce an incorrect result:
Example of the undesirable use of string addition: https://github.com/PulpQE/pulp-smash/blob/668f4b7fd5e88c5f9290e4d3b251be587e026f43/pulp_smash/utils.py#L106
I expect most clients of our REST API will use a urljoin implementation to combine paths, and pulp-smash should do the same.
The text was updated successfully, but these errors were encountered: