Skip to content

Commit

Permalink
azurefiles: fix missing x-ms-file-request-intent header
Browse files Browse the repository at this point in the history
According to the SDK docs

> FileRequestIntent is required when using TokenCredential for
> authentication. Acceptable value is backup.

This sets the correct option in the SDK. It does it for all types of
authentication but the SDK seems clever enough not to supply it when
it isn't needed.

This fixes the error

> MissingRequiredHeader An HTTP header that's mandatory for this
> request is not specified. x-ms-file-request-intent

Fixes rclone#8241
  • Loading branch information
ncw committed Dec 19, 2024
1 parent bc08e05 commit e1748a3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion backend/azurefiles/azurefiles.go
Original file line number Diff line number Diff line change
Expand Up @@ -393,8 +393,10 @@ func newFsFromOptions(ctx context.Context, name, root string, opt *Options) (fs.
policyClientOptions := policy.ClientOptions{
Transport: newTransporter(ctx),
}
backup := service.ShareTokenIntentBackup
clientOpt := service.ClientOptions{
ClientOptions: policyClientOptions,
ClientOptions: policyClientOptions,
FileRequestIntent: &backup,
}

// Here we auth by setting one of cred, sharedKeyCred or f.client
Expand Down

0 comments on commit e1748a3

Please sign in to comment.