Skip to content

Propfind

reference
1 min readUpdated

Kind: Constant

Source: packages/common/decorators/http/request-mapping.decorator.ts

Part of: Common

Route handler (method) Decorator. Routes Webdav PROPFIND requests to the specified path.

Propfind is a route-handler decorator that maps WebDAV PROPFIND requests to a controller method and optional path. It integrates with the HTTP request-mapping decorator system so WebDAV resource metadata and directory listing requests can be handled alongside standard HTTP routes.

Definition

ts
createMappingDecorator(RequestMethod.PROPFIND)

Value

ts
createMappingDecorator(RequestMethod.PROPFIND)

Diagram

mermaid
graph LR
  Client[WebDAV Client] -->|PROPFIND /resources/path| Router[HTTP Router]
  Router -->|Matches @Propfind path| Controller[Controller Method]
  Controller --> Handler[WebDAV PROPFIND Handler]
  Handler --> Response[Resource Properties Response]

Usage

ts
import { Controller } from '@nestjs/common';
import { Propfind } from '@your-package/common';

@Controller('files')
export class FilesController {
  @Propfind(':path')
  async getProperties() {
    return {
      displayname: 'example.txt',
      resourcetype: 'file',
      getcontentlength: 1024,
    };
  }
}

AI Coding Instructions

  • Use @Propfind() only for WebDAV PROPFIND handlers; use the corresponding request-mapping decorators for other HTTP or WebDAV methods.
  • Define a path argument when the handler must receive requests for a specific resource or nested resource path.
  • Ensure the handler returns data in the property format expected by the application's WebDAV response layer.
  • Keep PROPFIND handlers read-only; do not mutate files, metadata, or resource state during property lookup.
  • Place the decorator on controller methods within a controller that provides the appropriate route prefix.

Was this page helpful?

Download as PDF
Propfind — NestJS head-to-head