Skip to content

Commit

Permalink
[feature/download-etag-fallback] Fallback to Etag (#127)
Browse files Browse the repository at this point in the history
* - add `authentication.skip-www-authenticate-checks` option to allow force-skipping WWW-Authenticate checks during authentication method detection

* - OCAuthenticationMethodOAuth2: add support for alternative sending of client_id and client_secret in case token endpoint does not support passing them via Basic Auth (RFC 6749, section 2.3.1), new parameter `authentication-oauth2.post-client-id-and-secret`

* - OCConnection: if a download succeeds, but presents no "oc-etag" header, fall back to "Etag" header to determine the file's Etag
  • Loading branch information
felix-schwarz authored Oct 22, 2024
1 parent 6b7dcdf commit 88ba1f3
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion ownCloudSDK/Connection/OCConnection.m
Original file line number Diff line number Diff line change
Expand Up @@ -2303,7 +2303,14 @@ - (void)_handleDownloadItemResult:(OCHTTPRequest *)request error:(NSError *)erro
file.checksum = [OCChecksum checksumFromHeaderString:checksumString];
}

file.eTag = request.httpResponse.headerFields[@"oc-etag"];
OCFileETag eTag = request.httpResponse.headerFields[@"oc-etag"];
if (eTag == nil)
{
// Allow fallback to standard HTTP Etag if oc-etag is not available
eTag = request.httpResponse.headerFields[@"Etag"];
}

file.eTag = eTag;
file.fileID = file.item.fileID;

event.file = file;
Expand Down

0 comments on commit 88ba1f3

Please sign in to comment.