Skip to content

Commit 81606e8

Browse files
committed
fix(azure-http-router): meet requirements for v9 AbstractHttpAdapter
1 parent 83e5adc commit 81606e8

File tree

1 file changed

+27
-1
lines changed

1 file changed

+27
-1
lines changed

lib/router/azure-http.router.ts

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,14 @@
11
/* eslint-disable @typescript-eslint/ban-types */
22
/* eslint-disable @typescript-eslint/no-unused-vars */
33
/* eslint-disable @typescript-eslint/no-empty-function */
4-
import { HttpStatus, RequestMethod } from '@nestjs/common';
4+
import {
5+
HttpStatus,
6+
InternalServerErrorException,
7+
NotImplementedException,
8+
RequestMethod,
9+
VersioningOptions
10+
} from '@nestjs/common';
11+
import { VersionValue } from '@nestjs/common/interfaces';
512
import { CorsOptions } from '@nestjs/common/interfaces/external/cors-options.interface';
613
import { AbstractHttpAdapter } from '@nestjs/core';
714
import { RouterMethodFactory } from '@nestjs/core/helpers/router-method-factory';
@@ -62,6 +69,10 @@ export class AzureHttpRouter extends AbstractHttpAdapter {
6269
response.statusCode = statusCode;
6370
}
6471

72+
public end(response: any, message?: string) {
73+
return response.end(message);
74+
}
75+
6576
public getHttpServer<T = any>(): T {
6677
return this.instance as T;
6778
}
@@ -70,6 +81,10 @@ export class AzureHttpRouter extends AbstractHttpAdapter {
7081
return this.instance as T;
7182
}
7283

84+
public isHeadersSent(response: any): boolean {
85+
return response.headersSent;
86+
}
87+
7388
public setHeader(response: any, name: string, value: string) {
7489
return response.setHeader(name, value);
7590
}
@@ -98,6 +113,17 @@ export class AzureHttpRouter extends AbstractHttpAdapter {
98113
return 'azure-http';
99114
}
100115

116+
public applyVersionFilter(
117+
handler: Function,
118+
version: VersionValue,
119+
versioningOptions: VersioningOptions
120+
) {
121+
throw new NotImplementedException();
122+
return (req, res, next) => {
123+
return () => {};
124+
};
125+
}
126+
101127
public listen(port: any, ...args: any[]) {}
102128
public render(response: any, view: string, options: any) {}
103129
public redirect(response: any, statusCode: number, url: string) {}

0 commit comments

Comments
 (0)