remove proxy job queue

This commit is contained in:
iacore
2024-10-05 15:51:53 +00:00
parent 991fcea714
commit 845bbba3c7
+11 -2
View File
@@ -196,15 +196,24 @@ func API_POST(ctx context.Context, url, payload, userToken, csrf string, isJSON
func ProxyRequest(w http.ResponseWriter, req *http.Request) error {
resp, err := utils.HttpClient.Do(req)
if err != nil {
return err
return i18n.Errorf("failed to proxy request: %w", err)
}
defer resp.Body.Close()
// Copy response headers
header := w.Header()
for k, v := range resp.Header {
header[k] = v
}
// Set the status code
w.WriteHeader(resp.StatusCode)
// Copy the body from the response to the original writer
_, err = io.Copy(w, resp.Body)
return err
if err != nil {
return i18n.Errorf("failed to copy response body: %w", err)
}
return nil
}