mirror of
https://github.com/bewcloud/bewcloud.git
synced 2026-03-11 08:54:49 +00:00
Properly fix empty body on GET/HEAD for CardDav/CalDav
Related to 47f443c300
This commit is contained in:
parent
47f443c300
commit
f14c40d05d
3 changed files with 5 additions and 5 deletions
|
|
@ -1,6 +1,6 @@
|
|||
services:
|
||||
website:
|
||||
image: ghcr.io/bewcloud/bewcloud:v2.4.6
|
||||
image: ghcr.io/bewcloud/bewcloud:v2.4.7
|
||||
restart: always
|
||||
ports:
|
||||
- 127.0.0.1:8000:8000
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@ export const handler: Handler<Data, FreshContextState> = async (request, context
|
|||
const requestBodyText = await request.clone().text();
|
||||
|
||||
// Remove the `/caldav/` prefix from the hrefs in the request
|
||||
let parsedRequestBodyText = requestBodyText.replaceAll('<href>/caldav/', `<href>/`).replaceAll(
|
||||
let parsedRequestBodyText: string | undefined = requestBodyText.replaceAll('<href>/caldav/', `<href>/`).replaceAll(
|
||||
':href>/caldav/',
|
||||
`:href>/`,
|
||||
);
|
||||
|
||||
// The spec doesn't allow a body for GET or HEAD requests (and Deno fails if you try)
|
||||
if (request.method === 'GET' || request.method === 'HEAD') {
|
||||
parsedRequestBodyText = '';
|
||||
parsedRequestBodyText = undefined;
|
||||
}
|
||||
|
||||
const response = await fetch(`${calendarConfig.calDavUrl}/${path}`, {
|
||||
|
|
|
|||
|
|
@ -31,14 +31,14 @@ export const handler: Handler<Data, FreshContextState> = async (request, context
|
|||
const requestBodyText = await request.clone().text();
|
||||
|
||||
// Remove the `/carddav/` prefix from the hrefs in the request
|
||||
let parsedRequestBodyText = requestBodyText.replaceAll('<href>/carddav/', `<href>/`).replaceAll(
|
||||
let parsedRequestBodyText: string | undefined = requestBodyText.replaceAll('<href>/carddav/', `<href>/`).replaceAll(
|
||||
':href>/carddav/',
|
||||
`:href>/`,
|
||||
);
|
||||
|
||||
// The spec doesn't allow a body for GET or HEAD requests (and Deno fails if you try)
|
||||
if (request.method === 'GET' || request.method === 'HEAD') {
|
||||
parsedRequestBodyText = '';
|
||||
parsedRequestBodyText = undefined;
|
||||
}
|
||||
|
||||
const response = await fetch(`${contactsConfig.cardDavUrl}/${path}`, {
|
||||
|
|
|
|||
Loading…
Reference in a new issue