add https checking
This commit is contained in:
parent
e228250613
commit
e2e8265d43
@ -22,7 +22,7 @@ import { buildQueryString } from "@smithy/querystring-builder";
|
|||||||
import { HeaderBag, HttpHandlerOptions, Provider } from "@aws-sdk/types";
|
import { HeaderBag, HttpHandlerOptions, Provider } from "@aws-sdk/types";
|
||||||
import { Buffer } from "buffer";
|
import { Buffer } from "buffer";
|
||||||
import * as mime from "mime-types";
|
import * as mime from "mime-types";
|
||||||
import { Vault, requestUrl, RequestUrlParam } from "obsidian";
|
import { Vault, requestUrl, RequestUrlParam, Platform } from "obsidian";
|
||||||
import { Readable } from "stream";
|
import { Readable } from "stream";
|
||||||
import * as path from "path";
|
import * as path from "path";
|
||||||
import AggregateError from "aggregate-error";
|
import AggregateError from "aggregate-error";
|
||||||
@ -770,6 +770,13 @@ export const checkConnectivity = async (
|
|||||||
callbackFunc?: any
|
callbackFunc?: any
|
||||||
) => {
|
) => {
|
||||||
try {
|
try {
|
||||||
|
// TODO: no universal way now, just check this in connectivity
|
||||||
|
if (Platform.isIosApp && !s3Config.s3Endpoint.startsWith("https")) {
|
||||||
|
throw Error(
|
||||||
|
`Your s3 endpoint could only be https, not http, because of the iOS restriction.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// const results = await s3Client.send(
|
// const results = await s3Client.send(
|
||||||
// new HeadBucketCommand({ Bucket: s3Config.s3BucketName })
|
// new HeadBucketCommand({ Bucket: s3Config.s3BucketName })
|
||||||
// );
|
// );
|
||||||
|
|||||||
@ -228,6 +228,13 @@ export class WrappedWebdavClient {
|
|||||||
if (this.client !== undefined) {
|
if (this.client !== undefined) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (Platform.isIosApp && !this.webdavConfig.address.startsWith("https")) {
|
||||||
|
throw Error(
|
||||||
|
`Your webdav address could only be https, not http, because of the iOS restriction.`
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const headers = {
|
const headers = {
|
||||||
"Cache-Control": "no-cache",
|
"Cache-Control": "no-cache",
|
||||||
};
|
};
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user