Merge pull request #958 from vrtmrz/fix_875

Fix S3 client with custom headers and strict server
This commit is contained in:
vorotamoroz authored and GitHub committed 2026-06-15 19:41:31 +09:00
commit def1d297f5
2 files changed
+14 -3

No files matched your search

@@ -5,14 +5,24 @@
import { FetchHttpHandler, type FetchHttpHandlerOptions } from "@smithy/fetch-http-handler"; import { FetchHttpHandler, type FetchHttpHandlerOptions } from "@smithy/fetch-http-handler";
import { HttpRequest, HttpResponse, type HttpHandlerOptions } from "@smithy/protocol-http"; import { HttpRequest, HttpResponse, type HttpHandlerOptions } from "@smithy/protocol-http";
//@ts-ignore
import { requestTimeout } from "@smithy/fetch-http-handler/dist-es/request-timeout";
import { buildQueryString } from "@smithy/querystring-builder"; import { buildQueryString } from "@smithy/querystring-builder";
import { requestUrl, type RequestUrlParam } from "../../../deps.ts"; import { requestUrl, type RequestUrlParam } from "../../../deps.ts";
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
// special handler using Obsidian requestUrl // special handler using Obsidian requestUrl
//////////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////////////////////
function requestTimeout(timeoutInMs: number = 0): Promise<never> {
return new Promise((_, reject) => {
if (timeoutInMs) {
window.setTimeout(() => {
const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`);
timeoutError.name = "TimeoutError";
reject(timeoutError);
}, timeoutInMs);
}
});
}
/** /**
* This is close to origin implementation of FetchHttpHandler * This is close to origin implementation of FetchHttpHandler
* https://github.com/aws/aws-sdk-js-v3/blob/main/packages/fetch-http-handler/src/fetch-http-handler.ts * https://github.com/aws/aws-sdk-js-v3/blob/main/packages/fetch-http-handler/src/fetch-http-handler.ts
+2 -1
View File
@@ -6,7 +6,8 @@ The head note of 0.25 is now in [updates_old.md](https://github.com/vrtmrz/obsid
## Unreleased ## Unreleased
### Fixed ### Fixed
- Now the S3 connection with custom headers works properly (#875).
- Previously, custom headers injected for proxy authentication were incorrectly included in the AWS Signature v4 calculation. This led to a '400 Bad Request' error (such as 'signed header is not present') on strict S3 backends (for example, Garage), or when reverse proxies modified, renamed, or stripped these headers before they reached the storage service.
- No longer connection information of the P2P synchronisation is broken on the specific platform (#956). - No longer connection information of the P2P synchronisation is broken on the specific platform (#956).
## 0.25.75 ## 0.25.75