File tree Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Expand file tree Collapse file tree 3 files changed +19
-1
lines changed Original file line number Diff line number Diff line change 11export function lazyInherit ( target : any , source : any , sourceKey : any ) : void {
2- for ( const key of Object . getOwnPropertyNames ( source ) ) {
2+ for ( const key of [
3+ ...Object . getOwnPropertyNames ( source ) ,
4+ ...Object . getOwnPropertySymbols ( source ) ,
5+ ] ) {
36 if ( key === "constructor" ) continue ;
47 const targetDesc = Object . getOwnPropertyDescriptor ( target , key ) ! ;
58 const desc = Object . getOwnPropertyDescriptor ( source , key ) ! ;
Original file line number Diff line number Diff line change 1+ import { inspect } from "node:util" ;
12import type { ServerOptions } from "../src/types.ts" ;
23
34// prettier-ignore
@@ -213,6 +214,11 @@ export const fixture: (
213214 case "/abort-log" : {
214215 return _Response . json ( aborts ) ;
215216 }
217+ case "/node-inspect" : {
218+ return _Response . json ( {
219+ headers : inspect ( req . headers ) ,
220+ } ) ;
221+ }
216222 }
217223 return new _Response ( "404" , { status : 404 } ) ;
218224 } ,
Original file line number Diff line number Diff line change @@ -234,6 +234,15 @@ export function addTests(opts: {
234234 } ) ;
235235 } ) ;
236236
237+ test ( "inspect objects" , async ( ) => {
238+ const response = await fetch ( url ( "/node-inspect" ) , {
239+ headers : { "x-foo" : "1" } ,
240+ } ) ;
241+ expect ( response . status ) . toBe ( 200 ) ;
242+ const data = await response . text ( ) ;
243+ expect ( data . includes ( "x-foo" ) ) ;
244+ } ) ;
245+
237246 // TODO: Write test to make sure it is forbidden for http2/tls
238247 test . skipIf ( opts . http2 ) ( "absolute path in request line" , async ( ) => {
239248 const _url = new URL ( url ( "/" ) ) ;
You can’t perform that action at this time.
0 commit comments