Skip to content

Commit

Permalink
fix(fastify): uppercase http method names
Browse files Browse the repository at this point in the history
Fastify expects uppercase and won't auto-add the HEAD method otherwise

Closes #13016
  • Loading branch information
rickdgeerling committed Sep 20, 2024
1 parent 43e374c commit 29fca46
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions packages/platform-fastify/adapters/fastify-adapter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -289,35 +289,35 @@ export class FastifyAdapter<
}

public get(...args: any[]) {
return this.injectRouteOptions('get', ...args);
return this.injectRouteOptions('GET', ...args);
}

public post(...args: any[]) {
return this.injectRouteOptions('post', ...args);
return this.injectRouteOptions('POST', ...args);
}

public head(...args: any[]) {
return this.injectRouteOptions('head', ...args);
return this.injectRouteOptions('HEAD', ...args);
}

public delete(...args: any[]) {
return this.injectRouteOptions('delete', ...args);
return this.injectRouteOptions('DELETE', ...args);
}

public put(...args: any[]) {
return this.injectRouteOptions('put', ...args);
return this.injectRouteOptions('PUT', ...args);
}

public patch(...args: any[]) {
return this.injectRouteOptions('patch', ...args);
return this.injectRouteOptions('PATCH', ...args);
}

public options(...args: any[]) {
return this.injectRouteOptions('options', ...args);
return this.injectRouteOptions('OPTIONS', ...args);
}

public search(...args: any[]) {
return this.injectRouteOptions('search', ...args);
return this.injectRouteOptions('SEARCH', ...args);
}

public applyVersionFilter(
Expand Down

0 comments on commit 29fca46

Please sign in to comment.