Sync-in · Sovereign platform for file storage, sharing, synchronization, and collaboration.
TypeScript cloud-alternativecollaborationcollaborative-editingdropboxfile-serverfile-sharingfile-storagefile-syncfull-text-searchhomelabnextcloudon-premiseopen-sourceprivacy-firstprivate-cloudrealtimesecureself-hostedstorage-serverwebdav
fix(backend:webdav): set correct http status line
7185a651fc33d508
diff --git a/backend/src/applications/applications.constants.ts b/backend/src/applications/applications.constants.tsindex dcc600fe..6d709f03 100644--- a/backend/src/applications/applications.constants.ts+++ b/backend/src/applications/applications.constants.ts@@ -37,3 +37,5 @@ export const HTTP_METHOD = {} as constexport const HTTP_CSRF_IGNORED_METHODS = new Set<string>([HTTP_METHOD.GET, HTTP_METHOD.HEAD, HTTP_METHOD.OPTIONS, HTTP_METHOD.SEARCH])++export const HTTP_VERSION = 'HTTP/1.1'diff --git a/backend/src/applications/webdav/guards/webdav-protocol.guard.ts b/backend/src/applications/webdav/guards/webdav-protocol.guard.tsindex d78cbb19..943711e1 100644--- a/backend/src/applications/webdav/guards/webdav-protocol.guard.ts+++ b/backend/src/applications/webdav/guards/webdav-protocol.guard.ts@@ -9,7 +9,7 @@ import { ValidationError } from 'fast-xml-parser'import { FastifyReply } from 'fastify'import { urlToPath } from '../../../common/functions'import { decodeUrl } from '../../../common/shared'-import { HTTP_METHOD } from '../../applications.constants'+import { HTTP_METHOD, HTTP_VERSION } from '../../applications.constants'import { CACHE_LOCK_DEFAULT_TTL } from '../../files/constants/cache'import { USER_PERMISSION } from '../../users/constants/user'import {@@ -94,7 +94,7 @@ export class WebDAVProtocolGuard implements CanActivate {} else {throw new HttpException(`${valid.err.code} : ${valid.err.msg}`, HttpStatus.BAD_REQUEST)}- req.dav.httpVersion = `${req.protocol.toUpperCase()}/${req.raw['httpVersion']}`+ req.dav.httpVersion = HTTP_VERSIONreq.dav.body = bodyreturn true}diff --git a/backend/src/applications/webdav/services/webdav-methods.service.spec.ts b/backend/src/applications/webdav/services/webdav-methods.service.spec.tsindex af2e059f..994d3446 100644--- a/backend/src/applications/webdav/services/webdav-methods.service.spec.ts+++ b/backend/src/applications/webdav/services/webdav-methods.service.spec.ts@@ -6,6 +6,7 @@import { HttpException, HttpStatus } from '@nestjs/common'import { Test, TestingModule } from '@nestjs/testing'+import { HTTP_VERSION } from '../../applications.constants'import { FileLock } from '../../files/interfaces/file-lock.interface'import { FileError } from '../../files/models/file-error'import { LockConflict } from '../../files/models/file-lock-error'@@ -83,7 +84,7 @@ describe('WebDAVMethods', () => {dav: {url: '/webdav/test/file.txt',depth: '0',- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: '<lockinfo/>',lock: {timeout: 60,@@ -833,7 +834,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: { propertyupdate: { set: { prop: [{ lastmodified: '2024-01-01' }] } } }}})@@ -856,7 +857,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: { propertyupdate: { set: { prop: [{ unsupportedProp: 'value' }] } } }}})@@ -876,7 +877,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: { propertyupdate: { set: { prop: [{ Win32CreationTime: '2024-01-01' }] } } }}})@@ -898,7 +899,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: { propertyupdate: { set: { prop: [{ lastmodified: '2024-01-01' }] } } }}})@@ -917,7 +918,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: {propertyupdate: {set: { prop: [{ unsupportedProp: 'fail' }, { Win32CreationTime: 'ok' }] }@@ -945,7 +946,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: {propertyupdate: {remove: { prop: [{ Win32CreationTime: '' }] }@@ -973,7 +974,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: {propertyupdate: {set: [{ prop: { lastmodified: '2024-01-01' } }, { prop: { Win32CreationTime: 'ok' } }]@@ -998,7 +999,7 @@ describe('WebDAVMethods', () => {method: 'PROPPATCH',dav: {...createBaseRequest().dav,- httpVersion: 'HTTP/1.1',+ httpVersion: HTTP_VERSION,body: {propertyupdate: {set: { prop: { lastmodified: '2024-01-01' } }