Skip to content

Commit

Permalink
Include deployId search param during synchronization (#34)
Browse files Browse the repository at this point in the history
  • Loading branch information
amh4r authored Jan 31, 2024
1 parent 8f90d72 commit 5081aaf
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions handler.go
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,19 @@ func (h *handler) register(w http.ResponseWriter, r *http.Request) error {
scheme = "https"
}
host := r.Host
path := r.URL.String()

// Get the sync ID from the URL and then remove it, since we don't want the
// sync ID to show in the function URLs (that would affect the checksum and
// is ugly in the UI)
qp := r.URL.Query()
syncID := qp.Get("deployId")
qp.Del("deployId")
r.URL.RawQuery = qp.Encode()

pathAndParams := r.URL.String()

config := sdk.RegisterRequest{
URL: fmt.Sprintf("%s://%s%s", scheme, host, path),
URL: fmt.Sprintf("%s://%s%s", scheme, host, pathAndParams),
V: "1",
DeployType: "ping",
SDK: HeaderValueSDK,
Expand Down Expand Up @@ -342,6 +351,11 @@ func (h *handler) register(w http.ResponseWriter, r *http.Request) error {
if err != nil {
return fmt.Errorf("error creating new request: %w", err)
}
if syncID != "" {
qp := req.URL.Query()
qp.Set("deployId", syncID)
req.URL.RawQuery = qp.Encode()
}

key, err := hashedSigningKey([]byte(h.GetSigningKey()))
if err != nil {
Expand Down

0 comments on commit 5081aaf

Please sign in to comment.