mirror of https://github.com/veypi/OneAuth.git
You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
746 B
TypeScript
20 lines
746 B
TypeScript
import { joinURL } from "../tools/url";
|
|
import { encodePath } from "../tools/path";
|
|
import { request, prepareRequestOptions } from "../request";
|
|
import { handleResponseCode } from "../response";
|
|
import { RequestOptionsCustom, Response, WebDAVClientContext } from "../types";
|
|
|
|
export async function customRequest(
|
|
context: WebDAVClientContext,
|
|
remotePath: string,
|
|
requestOptions: RequestOptionsCustom
|
|
): Promise<Response> {
|
|
if (!requestOptions.url) {
|
|
requestOptions.url = joinURL(context.remoteURL, encodePath(remotePath));
|
|
}
|
|
const finalOptions = prepareRequestOptions(requestOptions, context, {});
|
|
const response = await request(finalOptions);
|
|
handleResponseCode(context, response);
|
|
return response;
|
|
}
|