rclone/backend/onedrive
Nick Craig-Wood 771ec943f2 onedrive: fix "unauthenticated: Unauthenticated" errors when uploading
Before this change, sometimes when uploading files the onedrive
servers return 401 Unauthorized errors with the text "unauthenticated:
Unauthenticated".

This is because we are sending the Authorization header with the
request and it says in the docs that we shouldn't.

https://learn.microsoft.com/en-us/graph/api/driveitem-createuploadsession?view=graph-rest-1.0#remarks

> If you include the Authorization header when issuing the PUT call,
> it may result in an HTTP 401 Unauthorized response. Only send the
> Authorization header and bearer token when issuing the POST during
> the first step. Don't include it when you issue the PUT call.

This patch fixes the problem by doing the PUT request with an
unauthenticated client.

Fixes #7405
See: https://forum.rclone.org/t/onedrive-unauthenticated-when-trying-to-copy-sync-but-can-use-lsd/41149/
See: https://forum.rclone.org/t/onedrive-unauthenticated-issue/43792/
2024-01-07 11:24:55 +00:00
..
api onedrive: implement ListR method which gives --fast-list support 2023-10-02 11:12:08 +01:00
quickxorhash onedrive: fix quickxorhash on 32 bit architectures 2023-04-13 15:14:46 +01:00
onedrive.go onedrive: fix "unauthenticated: Unauthenticated" errors when uploading 2024-01-07 11:24:55 +00:00
onedrive_test.go onedrive: add support for china region operated by 21vianet #4963 (#4963) 2021-01-29 23:04:21 +03:00