Compare commits
No commits in common. "753a6c9708c6b6530624879405e0dcd478797d70" and "242bf379a8d14a691e46132bd756a7a87807fa57" have entirely different histories.
753a6c9708
...
242bf379a8
|
@ -132,17 +132,17 @@ func (s *Server) Exec(ctx context.Context, callableOrFuncname any, args ...inter
|
|||
value := result.value
|
||||
|
||||
if promise, ok := IsPromise(value); ok {
|
||||
return s.waitForPromise(promise), nil
|
||||
value = s.waitForPromise(promise)
|
||||
}
|
||||
|
||||
return value.Export(), nil
|
||||
}
|
||||
}
|
||||
|
||||
func (s *Server) waitForPromise(promise *goja.Promise) any {
|
||||
func (s *Server) waitForPromise(promise *goja.Promise) goja.Value {
|
||||
var (
|
||||
wg sync.WaitGroup
|
||||
value any
|
||||
value goja.Value
|
||||
)
|
||||
|
||||
wg.Add(1)
|
||||
|
@ -162,7 +162,7 @@ func (s *Server) waitForPromise(promise *goja.Promise) any {
|
|||
return
|
||||
}
|
||||
|
||||
value = promise.Result().Export()
|
||||
value = promise.Result()
|
||||
|
||||
breakLoop = true
|
||||
})
|
||||
|
|
|
@ -2,7 +2,6 @@ package blob
|
|||
|
||||
import (
|
||||
"encoding/json"
|
||||
"io"
|
||||
"io/fs"
|
||||
"mime/multipart"
|
||||
"net/http"
|
||||
|
@ -165,14 +164,7 @@ func handleAppDownload(w http.ResponseWriter, r *http.Request) {
|
|||
}
|
||||
}()
|
||||
|
||||
// TODO Fix usage of ServeContent
|
||||
// http.ServeContent(w, r, string(replyMessage.BlobInfo.ID()), replyMessage.BlobInfo.ModTime(), replyMessage.Blob)
|
||||
|
||||
w.Header().Add("Content-Type", replyMessage.BlobInfo.ContentType())
|
||||
|
||||
if _, err := io.Copy(w, replyMessage.Blob); err != nil {
|
||||
logger.Error(ctx, "could not write blob", logger.CapturedE(errors.WithStack(err)))
|
||||
}
|
||||
http.ServeContent(w, r, string(replyMessage.BlobInfo.ID()), replyMessage.BlobInfo.ModTime(), replyMessage.Blob)
|
||||
}
|
||||
|
||||
type uploadedFile struct {
|
||||
|
|
Loading…
Reference in New Issue