Skip to content

Commit

Permalink
fix header prop
Browse files Browse the repository at this point in the history
  • Loading branch information
aviramha committed Jul 17, 2023
1 parent 6f08443 commit 1478172
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
8 changes: 6 additions & 2 deletions ip-info/mirrord.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@

{
"pause": true,
"accept_invalid_certificates": false,
"target": {
"path": {
Expand All @@ -9,7 +8,12 @@
},
"feature": {
"network": {
"incoming": "steal",
"incoming": {
"mode": "steal",
"http_filter": {
"header_filter": "X-PG-Tenant: Aviram"
}
},
"outgoing": true
},
"fs": {
Expand Down
4 changes: 2 additions & 2 deletions ip-visit-counter/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func getCount(c *gin.Context) {
ip := c.ClientIP()
key := RedisKey + ip
// header propagation
c.Set("PG-Tenant", c.GetHeader("x-pg-tenant"))
c.Set("x-pg-tenant", c.GetHeader("x-pg-tenant"))

count, err := RedisClient.Incr(c, key).Result()
if err != nil {
Expand Down Expand Up @@ -128,7 +128,7 @@ func getCount(c *gin.Context) {
tenant, exists := c.Get("x-pg-tenant")
if exists {
if tenantStr, ok := tenant.(string); ok {
req.Header.Add("x-pg-tenant", tenantStr)
req.Header.Set("x-pg-tenant", tenantStr)
}
}

Expand Down
3 changes: 1 addition & 2 deletions ip-visit-counter/mirrord.json
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,9 @@
"feature": {
"network": {
"incoming": {
"on_concurrent_steal": "continue",
"mode": "steal",
"http_filter": {
"header_filter": "PG-Tenant: Aviram"
"header_filter": "X-PG-Tenant: Aviram"
}
},
"outgoing": true
Expand Down

0 comments on commit 1478172

Please sign in to comment.