We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef2707c commit 86ff508Copy full SHA for 86ff508
1 file changed
Sources/NextcloudKit/NKCommon.swift
@@ -377,6 +377,17 @@ public struct NKCommon: Sendable {
377
return nil
378
}
379
380
+ /// Normalizes an HTTP ETag value by removing wrapping quotes when present.
381
+ /// - Parameter value: The raw ETag header value returned by the HTTP response.
382
+ /// - Returns: The normalized ETag value without surrounding double quotes.
383
+ public func normalizedETag(_ value: String?) -> String? {
384
+ guard let value else {
385
+ return nil
386
+ }
387
+
388
+ return value.trimmingCharacters(in: CharacterSet(charactersIn: "\""))
389
390
391
func getHostName(urlString: String) -> String? {
392
if let url = URL(string: urlString) {
393
guard let hostName = url.host else { return nil }
0 commit comments