mirror of
https://github.com/vrtmrz/obsidian-livesync.git
synced 2026-06-17 20:00:13 +00:00
### Fixed
- Now S3 connection with custom headers works properly.
This commit is contained in:
@@ -5,14 +5,24 @@
|
||||
|
||||
import { FetchHttpHandler, type FetchHttpHandlerOptions } from "@smithy/fetch-http-handler";
|
||||
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 { requestUrl, type RequestUrlParam } from "../../../deps.ts";
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
// 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
|
||||
* https://github.com/aws/aws-sdk-js-v3/blob/main/packages/fetch-http-handler/src/fetch-http-handler.ts
|
||||
|
||||
Reference in New Issue
Block a user