Add Regex skipPath/skipDomain to Builder, fixes #1236#1242
Conversation
| executeRequestForPath(client, "/", "Response from /") | ||
| val transaction = chuckerInterceptorWithoutSkipping.expectTransaction() | ||
| assertThat(transaction.responseBody).isEqualTo("Response from /") | ||
| chuckerInterceptorWithoutSkipping.expectNoTransactions() |
There was a problem hiding this comment.
Added chuckerInterceptorWithoutSkipping.expectNoTransactions() to ensure false positive checks.
cortinico
left a comment
There was a problem hiding this comment.
Code looks good to me @VenomVendor 👍
Thanks for adding this. I've left some comments on the API but we can merge it just after it
| * ".*path/ends/with/dev$".toRegex(), | ||
| * ``` | ||
| */ | ||
| public fun skipPaths(vararg skipPaths: Regex): Builder = |
There was a problem hiding this comment.
This doesn't need to be a vararg, it can just be a single Regex
| * ".*.dev$".toRegex(), | ||
| * ``` | ||
| */ | ||
| public fun skipDomain(vararg skipDomain: Regex): Builder = |
There was a problem hiding this comment.
If we add this, we'll have to add also skipDomain(vararg skipDomain: String)
Also here please remove the vararg
There was a problem hiding this comment.
vararg to be removed.
Should we have both string and regex or deprecate string?
There was a problem hiding this comment.
We can have both 👍 they're so simple no need to deprecate the Regex
cortinico
left a comment
There was a problem hiding this comment.
Don't forget to add also skipDomain(vararg skipDomain: String) 👍 and then we can merge this
📷 Screenshots
When
.skipPaths(".*(jpg|jpeg|png|gif|webp|svg|bmp|ico)$".toRegex())is setfilter-image.mp4
When
.skipDomain(".*akamai.com".toRegex(), "httpbin.org".toRegex())is setfilter-domain.mp4
📄 Context
Fixes #1236
📝 Changes
skipPath(...Regex)skipDomain(...Regex)🛠️ How to test
Check commmit eaff3e1, and uncomment
skipPathand/orskipDomainas needed.