test(blossom-bridge): inline the share.yabu.me URL literally
Building the URL from extracted prefix/blob constants could mask a parser bug that splits the path the same way the test constructs it. Use the full URL from the bug report as a single literal so the test only agrees with the parser if the parser actually parses the URL correctly.
This commit is contained in:
+8
-4
@@ -135,13 +135,17 @@ class LocalBlossomCacheRedirectInterceptorTest {
|
||||
@Test
|
||||
fun bridgeOnPicksRightmostShaWhenPathHasTwoHashes() {
|
||||
// share.yabu.me layout: <cache-prefix-sha>/<blob-sha>.<ext>
|
||||
val prefix = "84b0c46ab699ac35eb2ca286470b85e081db2087cdef63932236c397417782f5"
|
||||
val blob = "28fa4d999af6ae3e4e11bfc2727130ef1b3a13cc0f981e5a93c3996cb2f524e5"
|
||||
val interceptor = LocalBlossomCacheRedirectInterceptor { true }
|
||||
val captured = mutableListOf<String>()
|
||||
val response = interceptor.intercept(fakeChain("https://share.yabu.me/$prefix/$blob.webp", captured))
|
||||
val response =
|
||||
interceptor.intercept(
|
||||
fakeChain(
|
||||
"https://share.yabu.me/84b0c46ab699ac35eb2ca286470b85e081db2087cdef63932236c397417782f5/28fa4d999af6ae3e4e11bfc2727130ef1b3a13cc0f981e5a93c3996cb2f524e5.webp",
|
||||
captured,
|
||||
),
|
||||
)
|
||||
assertEquals(
|
||||
"http://127.0.0.1:24242/$blob.webp?xs=https%3A%2F%2Fshare.yabu.me%2F$prefix",
|
||||
"http://127.0.0.1:24242/28fa4d999af6ae3e4e11bfc2727130ef1b3a13cc0f981e5a93c3996cb2f524e5.webp?xs=https%3A%2F%2Fshare.yabu.me%2F84b0c46ab699ac35eb2ca286470b85e081db2087cdef63932236c397417782f5",
|
||||
captured.single(),
|
||||
)
|
||||
response.close()
|
||||
|
||||
Reference in New Issue
Block a user