feat(14-03): tide keeps binary upstream bodies and compares every *_url upload by shape

- A response body that is not valid UTF-8 (a cover image) is written as a
  YAML !!binary scalar, never masked and replayed byte for byte
- The upload URL normalizer covers every key ending in _url (cover_url),
  not only url and thumb_url
- README and parity-testing docs updated
This commit is contained in:
Jakub Zych
2026-10-03 21:34:52 +02:00
parent 2ee97c62f6
commit 5101ecb49c
6 changed files with 115 additions and 10 deletions

View File

@@ -30,6 +30,10 @@ func TestNormalizeMaskEdges(t *testing.T) {
`{"url":"/files/<partition>/<disk_name>.jpg"}`, 0},
{"upload under another prefix", `{"url":"/elsewhere/6ab/f82/1c3/6abf821c3d4e5f6a7b8c9d.png"}`, "", Step{}, "", 1},
{"plain url kept", `{"url":"https://example.com/a.png"}`, "", Step{}, `{"url":"https://example.com/a.png"}`, 0},
{"any _url key", `{"cover_url":"` + orig + `","master_url":"https://api.example.test/masters/1"}`, "", Step{},
`{"cover_url":"` + DefaultUploadPrefix + `/<partition>/<disk_name>.png","master_url":"https://api.example.test/masters/1"}`, 0},
{"_url key under another prefix", `{"cover_url":"/elsewhere/6ab/f82/1c3/6abf821c3d4e5f6a7b8c9d.png"}`, "", Step{}, "", 1},
{"_urls list not masked", `{"cover_urls":["` + orig + `"]}`, "", Step{}, `{"cover_urls":["` + orig + `"]}`, 0},
{"non-string url kept", `{"url":5,"thumb_url":null}`, "", Step{}, `{"thumb_url":null,"url":5}`, 0},
{"slug never masked", `{"slug":"abc_id","id":7}`, "", Step{}, `{"id":"<id>","slug":"abc_id"}`, 0},
{"collection key", `{"collection_key":"e53f1bd22f01bbe8268079f016301ad5","client_id":null}`, "", Step{}, `{"client_id":null,"collection_key":"<id>"}`, 0},