File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -505,18 +505,18 @@ func cpH(onIncomingFile js.Value, downloadFile js.Value) http.HandlerFunc {
505
505
}),
506
506
}
507
507
508
- var allow bool
508
+ allow := make ( chan bool )
509
509
onIncomingFile .Invoke (peer , fiName , r .ContentLength ).
510
510
Call ("then" , js .FuncOf (func (this js.Value , args []js.Value ) any {
511
- allow = args [0 ].Bool ()
511
+ allow <- args [0 ].Bool ()
512
512
return nil
513
513
})).
514
514
Call ("catch" , js .FuncOf (func (this js.Value , args []js.Value ) any {
515
515
fmt .Println ("onIncomingFile failed:" , args [0 ].String ())
516
- allow = false
516
+ allow <- false
517
517
return nil
518
518
}))
519
- if ! allow {
519
+ if ! <- allow {
520
520
w .WriteHeader (http .StatusForbidden )
521
521
w .Write ([]byte ("File transfer was denied" ))
522
522
r .Body .Close ()
You can’t perform that action at this time.
0 commit comments