Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
wj00037 committed Nov 7, 2024
1 parent 8cc3778 commit 4c3fcda
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 6 deletions.
5 changes: 1 addition & 4 deletions batch/types.go
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
package batch

import (
"time"
)
import "time"

type Request struct {
Operation string `json:"operation"`
Expand All @@ -27,7 +25,6 @@ type ErrorResponse struct {
RequestID string `json:"request_id,omitempty"`
}

// Action.objects.actions.header
type Action struct {
HRef string `json:"href"`
Header map[string]string `json:"header,omitempty"`
Expand Down
6 changes: 4 additions & 2 deletions server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -79,17 +79,18 @@ func New(o Options) (http.Handler, error) {

client, err := obs.New(o.AccessKeyID, o.SecretAccessKey, o.Endpoint, obs.WithSignature(obs.SignatureObs))
if err != nil {
fmt.Printf("Create obsClient error, errMsg: %s", err.Error())
return nil, err
}

s := &server{
ttl: o.TTL,
client: client,
bucket: o.Bucket,
prefix: o.Prefix,
ttl: o.TTL,
cdnDomain: o.CdnDomain,
isAuthorized: o.IsAuthorized,
}

r := chi.NewRouter()

r.Get("/", s.healthCheck)
Expand Down Expand Up @@ -249,6 +250,7 @@ func (s *server) handleBatch(w http.ResponseWriter, r *http.Request) {
}
}
}

must(json.NewEncoder(w).Encode(resp))
}

Expand Down

0 comments on commit 4c3fcda

Please sign in to comment.