Skip to content

Commit

Permalink
keep rto (#559)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakthom authored May 3, 2023
1 parent 52d90b8 commit 3d9b5f0
Show file tree
Hide file tree
Showing 5 changed files with 7 additions and 8 deletions.
2 changes: 1 addition & 1 deletion .VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v0.16.3
v0.16.4
2 changes: 1 addition & 1 deletion pkg/constants/buz.go
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ const (
BUZ_VALID_EVENTS string = "buz_valid_events"
BUZ_INVALID_EVENTS string = "buz_invalid_events"
BUZ string = "buz"
BUZ_REDIRECT_PARAM string = "z"
BUZ_REDIRECT_TO_PARAM string = "rto"
)
3 changes: 1 addition & 2 deletions pkg/protocol/pixel/eventBuilder.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ import (
"encoding/json"

"github.com/gin-gonic/gin"
"github.com/silverton-io/buz/pkg/constants"
"github.com/silverton-io/buz/pkg/envelope"
"github.com/silverton-io/buz/pkg/util"
)
Expand All @@ -20,7 +19,7 @@ const (
)

func buildEvent(c *gin.Context) (envelope.SelfDescribingPayload, error) {
params := util.MapUrlParams(c, constants.BUZ_REDIRECT_PARAM) // Remove reserved redirect param
params := util.MapUrlParams(c)
schemaName := util.GetSchemaNameFromRequest(c, ARBITRARY_PIXEL_SCHEMA)
base64EncodedPayload := params[B64_ENCODED_PAYLOAD_PARAM]
if base64EncodedPayload != nil {
Expand Down
4 changes: 2 additions & 2 deletions pkg/protocol/pixel/input.go
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@ func (i *PixelInput) Handler(m manifold.Manifold, conf config.Config, metadata *
c.Header("Retry-After", response.RETRY_AFTER_60)
c.JSON(http.StatusServiceUnavailable, response.ManifoldDistributionError)
} else {
redirectUrl, _ := c.GetQuery(constants.BUZ_REDIRECT_PARAM)
redirectUrl, _ := c.GetQuery(constants.BUZ_REDIRECT_TO_PARAM)
if redirectUrl != "" {
log.Debug().Msg("🟢 redirecting to " + redirectUrl)
log.Debug().Msg("🟡 redirecting to " + redirectUrl)
c.Redirect(http.StatusFound, redirectUrl)
}
b, _ := base64.StdEncoding.DecodeString(PX)
Expand Down
4 changes: 2 additions & 2 deletions schemas/io.silverton/buz/pixel/linkClick/v1.0.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,9 @@
},
"type": "object",
"properties": {
"link": {
"rto": {
"type": "string",
"description": "The link"
"description": "The link that was redirected to"
}
},
"additionalProperties": true,
Expand Down

0 comments on commit 3d9b5f0

Please sign in to comment.