@@ -60,7 +60,7 @@ export default function init({ projectControl, isPersonal }: Options) {
60
60
if ( req . headers [ "cookie" ] != null ) {
61
61
let cookie ;
62
62
( { cookie, remember_me, api_key } = stripRememberMeCookie (
63
- req . headers [ "cookie" ]
63
+ req . headers [ "cookie" ] ,
64
64
) ) ;
65
65
req . headers [ "cookie" ] = cookie ;
66
66
}
@@ -71,7 +71,7 @@ export default function init({ projectControl, isPersonal }: Options) {
71
71
// definitely block access. 4xx since this is a *client* problem.
72
72
const url = await siteUrl ( ) ;
73
73
throw Error (
74
- `Please login to <a target='_blank' href='${ url } '>${ url } </a> with cookies enabled, then refresh this page.`
74
+ `Please login to <a target='_blank' href='${ url } '>${ url } </a> with cookies enabled, then refresh this page.` ,
75
75
) ;
76
76
}
77
77
@@ -94,15 +94,15 @@ export default function init({ projectControl, isPersonal }: Options) {
94
94
dbg ( "using cached proxy" ) ;
95
95
proxy = cache . get ( target ) ;
96
96
} else {
97
- dbg ( "make a new proxy server to" , target ) ;
97
+ logger . debug ( "make a new proxy server to" , target ) ;
98
98
proxy = createProxyServer ( {
99
99
ws : false ,
100
100
target,
101
101
timeout : 60000 ,
102
102
} ) ;
103
103
// and cache it.
104
104
cache . set ( target , proxy ) ;
105
- dbg ( "created new proxy" ) ;
105
+ logger . debug ( "created new proxy" ) ;
106
106
// setup error handler, so that if something goes wrong with this proxy (it will,
107
107
// e.g., on project restart), we properly invalidate it.
108
108
const remove_from_cache = ( ) => {
@@ -111,11 +111,14 @@ export default function init({ projectControl, isPersonal }: Options) {
111
111
} ;
112
112
113
113
proxy . on ( "error" , ( e ) => {
114
- dbg ( "http proxy error event (ending proxy)" , e ) ;
114
+ logger . debug ( "http proxy error event (ending proxy)" , e ) ;
115
115
remove_from_cache ( ) ;
116
116
} ) ;
117
117
118
- proxy . on ( "close" , remove_from_cache ) ;
118
+ proxy . on ( "close" , ( ) => {
119
+ logger . debug ( "http proxy close event (ending proxy)" ) ;
120
+ remove_from_cache ( ) ;
121
+ } ) ;
119
122
}
120
123
121
124
if ( internal_url != null ) {
0 commit comments