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:
@@ -73,7 +73,7 @@ func maskLeaf(path string, val any, step Step, opts maskOptions, diffs *[]Diff)
|
||||
if key == "slug" || disabledPath(step, path, key) {
|
||||
return val
|
||||
}
|
||||
if key == "url" || key == "thumb_url" {
|
||||
if isUploadURLKey(key) {
|
||||
if s, ok := val.(string); ok {
|
||||
return maskUploadURL(path, s, opts.prefix(), diffs)
|
||||
}
|
||||
@@ -101,6 +101,14 @@ func maskLeaf(path string, val any, step Step, opts maskOptions, diffs *[]Diff)
|
||||
return val
|
||||
}
|
||||
|
||||
// isUploadURLKey reports the keys whose string values are compared as
|
||||
// uploaded-file URLs: url and every key ending in _url (thumb_url,
|
||||
// cover_url). A value outside the uploads prefix that does not look like an
|
||||
// upload is compared as it is.
|
||||
func isUploadURLKey(key string) bool {
|
||||
return key == "url" || strings.HasSuffix(key, "_url")
|
||||
}
|
||||
|
||||
func maskDate(path string, val any, diffs *[]Diff) any {
|
||||
if val == nil {
|
||||
return nil
|
||||
|
||||
Reference in New Issue
Block a user