@@ -24,7 +24,7 @@ app.add('GET', '/:user/:repo/releases/download/*', async (request, context) => {
2424 `https://github.com/${ user } /${ repo } /releases/download/${ wild } ` ,
2525 {
2626 redirect : 'follow' ,
27- headers : range ? headers : undefined ,
27+ headers : range === null ? headers : undefined ,
2828 } ,
2929 ) ;
3030} ) ;
@@ -46,7 +46,7 @@ app.add('GET', '/:user/:repo/releases/latest/download/:artifact', async (request
4646 `https://github.com/${ user } /${ repo } /releases/latest/download/${ artifact } ` ,
4747 {
4848 redirect : 'follow' ,
49- headers : range ? headers : undefined ,
49+ headers : range === null ? headers : undefined ,
5050 } ,
5151 ) ;
5252} ) ;
@@ -101,7 +101,7 @@ app.add('GET', '/:user/:repo/raw/*', async (_, context) => {
101101
102102app . add ( 'GET' , '/:user/:repo/info/refs' , async ( request , context ) => {
103103 const service = context . url . searchParams . get ( 'service' ) ;
104- if ( ! service ) {
104+ if ( service === null ) {
105105 return reply ( 403 , `Please upgrade your git client.
106106GitHub.com no longer supports git over dumb-http: https://github.com/blog/809` ) ;
107107 }
@@ -118,7 +118,7 @@ GitHub.com no longer supports git over dumb-http: https://github.com/blog/809`);
118118 const headers = new Headers ( ) ;
119119 const protocol = request . headers . get ( 'git-protocol' ) ;
120120
121- if ( protocol ) {
121+ if ( protocol !== null ) {
122122 headers . set ( 'Git-Protocol' , protocol ) ;
123123 }
124124
@@ -138,15 +138,15 @@ app.add('POST', '/:user/:repo/git-upload-pack', async (request, context) => {
138138 const type = request . headers . get ( 'content-type' ) ;
139139 const encoding = request . headers . get ( 'content-encoding' ) ;
140140
141- if ( protocol ) {
141+ if ( protocol !== null ) {
142142 headers . set ( 'Git-Protocol' , protocol ) ;
143143 }
144144
145- if ( type ) {
145+ if ( type !== null ) {
146146 headers . set ( 'Content-Type' , type ) ;
147147 }
148148
149- if ( encoding ) {
149+ if ( encoding !== null ) {
150150 headers . set ( 'Content-Encoding' , encoding ) ;
151151 }
152152
0 commit comments