Solution: method skipPaths on builder does not work as expected, issue #1237 #1290
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
📄 Context
The Issue occurs when we add path segments delimited by '/' as part of the filtering mechanism, and HttpUrl treats them as a single, large path segment.
📝 Changes
I added methods to safely add skips_path.
Why not use HttpUrl::addPathSegments?
The problem with addPathSegments is that it replaces a leading '/' with an empty path segment, turning '/' into '//'. This causes issues for HttpUrl in general.
For example
Both MockWebServer::url and HttpUrl.Builder::resolve don't handle '//' segments properly.
I consider these results problematic for our tests as the logic is changed here.
Even if we found a workaround, user inputs would still be transformed from '/path/to/test' to '//path/to/test', which leads to unexpected behavior.
Comparison table for user input conversion using HttpUrl method and custom extension
Should we consider removing full URLs with hosts from tests, since there is a separate field for that purpose - 'skipDomain'?
🚫 Breaking
Duplicated and empty path segments will be ignored once this change is applied.