Browse Source

Merge pull request #115 from langgenius/fix/close-serverless-response

fix: Ensure response body is closed after reading in AWSPluginRuntime
Yeuoly 4 months ago
parent
commit
84edb2682d
1 changed files with 1 additions and 0 deletions
  1. 1 0
      internal/core/plugin_manager/serverless_runtime/io.go

+ 1 - 0
internal/core/plugin_manager/serverless_runtime/io.go

@@ -91,6 +91,7 @@ func (r *AWSPluginRuntime) Write(sessionId string, action access_types.PluginAcc
 
 		// write to data stream
 		scanner := bufio.NewScanner(response.Body)
+		defer response.Body.Close()
 
 		// TODO: set a reasonable buffer size or use a reader, this is a temporary solution
 		scanner.Buffer(make([]byte, 1024), 5*1024*1024)