File tree Expand file tree Collapse file tree 2 files changed +4
-2
lines changed
Expand file tree Collapse file tree 2 files changed +4
-2
lines changed Original file line number Diff line number Diff line change @@ -7,6 +7,7 @@ module.exports = function(req, res) {
77 const cmd = req . query . cmd ;
88 const url = req . query . url ;
99 const file = req . file ;
10+ const startTime = Date . now ( ) ;
1011 if ( ! cmd ) return res . error ( 'cmd' ) ;
1112 if ( ! file && ! url ) return res . error ( 'file' ) ;
1213 const command = cmd . split ( '/' ) ;
@@ -29,6 +30,7 @@ module.exports = function(req, res) {
2930 // })
3031 . videoFilters ( 'boxblur=1:' + blurV + ':cr=0:ar=0' )
3132 . on ( 'end' , function ( ) {
33+ console . log ( 'end' , filepath , Date . now ( ) - startTime ) ;
3234 const stat = fs . statSync ( filepath ) ;
3335 const total = stat . size ;
3436 res . writeHead ( 200 , { 'Content-Length' : total , 'Content-Type' : 'video/mp4' } ) ;
Original file line number Diff line number Diff line change @@ -13,8 +13,8 @@ app.use(router);
1313router . use ( ( req , res , next ) => {
1414 if ( req . path === '/handler' && req . method === 'POST' ) {
1515 let length = req . headers [ 'content-length' ] ;
16- console . log ( req . headers ) ;
17- if ( length === 0 ) next ( ) ;
16+ console . log ( JSON . stringify ( req . headers ) ) ;
17+ if ( length == 0 ) return next ( ) ;
1818 const filename = Math . random ( ) . toString ( 36 ) . substr ( 2 ) ;
1919 const filepath = path . resolve ( '/tmp/' , filename )
2020 const writerStream = fs . createWriteStream ( filepath ) ;
You can’t perform that action at this time.
0 commit comments