Skip to content

Commit

Permalink
Fixes loading from disk cache when cached headers contain non-ASCII c…
Browse files Browse the repository at this point in the history
…haracters coil-kt#1838

Allows disk cache headers to be updated after a 304 Not Modified, as detailed in coil-kt#1838
  • Loading branch information
Dave Jones committed Aug 8, 2023
1 parent ce713ff commit fb0f3d1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions coil-base/src/main/java/coil/network/CacheStrategy.kt
Original file line number Diff line number Diff line change
Expand Up @@ -242,14 +242,14 @@ internal class CacheStrategy private constructor(
continue
}
if (isContentSpecificHeader(name) || !isEndToEnd(name) || networkHeaders[name] == null) {
result.add(name, value)
result.addUnsafeNonAscii(name, value)
}
}

for (index in 0 until networkHeaders.size) {
val fieldName = networkHeaders.name(index)
if (!isContentSpecificHeader(fieldName) && isEndToEnd(fieldName)) {
result.add(fieldName, networkHeaders.value(index))
result.addUnsafeNonAscii(fieldName, networkHeaders.value(index))
}
}

Expand Down

0 comments on commit fb0f3d1

Please sign in to comment.