File tree 2 files changed +6
-2
lines changed
2 files changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -475,7 +475,7 @@ export class Server<A = ServerApplicationState> {
475
475
* @return Return value: the route information if found, otherwise null.
476
476
* [See docs](https://github.com/hapijs/hapi/blob/master/API.md#-servermatchmethod-path-host)
477
477
*/
478
- match ( method : HTTP_METHODS , path : string , host ?: string | undefined ) : RequestRoute | null ;
478
+ match ( method : HTTP_METHODS | Lowercase < HTTP_METHODS > , path : string , host ?: string | undefined ) : RequestRoute | null ;
479
479
480
480
/**
481
481
* Registers a server method where:
Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ import { expect } from '@hapi/code';
4
4
import {
5
5
Plugin ,
6
6
Request ,
7
+ RequestRoute ,
7
8
ResponseToolkit ,
8
9
Server ,
9
10
ServerRoute ,
@@ -77,7 +78,7 @@ const plugin: Plugin<TestPluginOptions, TestPluginDecorations> = {
77
78
register : function ( srv : MyServer , options ) {
78
79
79
80
check . type < TestPluginOptions > ( options ) ;
80
-
81
+
81
82
srv . expose ( {
82
83
add : function ( a : number , b : number ) {
83
84
@@ -89,6 +90,9 @@ const plugin: Plugin<TestPluginOptions, TestPluginDecorations> = {
89
90
90
91
const loadedServer = await server . register ( { plugin, options : { x : 10 } } ) ;
91
92
93
+ check . type < RequestRoute | null > ( server . match ( 'GET' , '/' ) ) ;
94
+ check . type < RequestRoute | null > ( server . match ( 'get' , '/' ) ) ;
95
+
92
96
const sum = loadedServer . plugins . test . add ( 1 , 2 ) ;
93
97
expect ( sum ) . to . equal ( 130 ) ;
94
98
check . type < number > ( sum ) ;
You can’t perform that action at this time.
0 commit comments