8000 gzip support for ingestion API by lmangani · Pull Request #75 · gigapi/gigapi · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

gzip support for ingestion API #75

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Apr 24, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8000
16 changes: 15 additions & 1 deletion merge/handlers/insert_into.go
554C
Original file line number Diff line number Diff line change
@@ -1,11 +1,13 @@
package handlers

import (
"compress/gzip"
"context"
"github.com/gigapi/gigapi/merge/parsers"
"github.com/gigapi/gigapi/merge/repository"
"github.com/gigapi/gigapi/utils"
"github.com/gorilla/mux"
"io"
"net/http"
)

Expand Down Expand Up @@ -35,7 +37,19 @@ func InsertIntoHandler(w http.ResponseWriter, r *http.Request) error {
if err != nil {
return err
}
res, err := parser.ParseReader(ctx, r.Body)

// Handle gzip compression
var reader io.Reader = r.Body
if r.Header.Get("Content-Encoding") == "gzip" {
gzipReader, err := gzip.NewReader(r.Body)
if err != nil {
return err
}
defer gzipReader.Close()
reader = gzipReader
}

res, err := parser.ParseReader(ctx, reader)
if err != nil {
return err
}
Expand Down
0