Skip to content
Merged
Show file tree
Hide file tree
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
2 changes: 1 addition & 1 deletion splitio/commitversion.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,4 +5,4 @@ This file is created automatically, please do not edit
*/

// CommitVersion is the version of the last commit previous to release
const CommitVersion = "8fd26d7"
const CommitVersion = "4f19e34"
2 changes: 1 addition & 1 deletion splitio/proxy/controllers/sdk_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ func TestSplitChangesImpressionsDisabled(t *testing.T) {
&rbsStorage,
flagsets.NewMatcher(false, nil),
&largeSegmentStorageMock,
specs.FLAG_V1_2,
specs.FLAG_V1_3,
)
controller.Register(group)

Expand Down
6 changes: 6 additions & 0 deletions splitio/proxy/proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"fmt"
"net/http"

"github.com/splitio/split-synchronizer/v5/splitio"
"github.com/splitio/split-synchronizer/v5/splitio/common/impressionlistener"
"github.com/splitio/split-synchronizer/v5/splitio/proxy/controllers"
"github.com/splitio/split-synchronizer/v5/splitio/proxy/controllers/middleware"
Expand Down Expand Up @@ -145,6 +146,11 @@ func New(options *Options) *API {
cacheableRouter.Use(options.Cache.Handle)
cacheableRouter.Use(gzip.Gzip(gzip.DefaultCompression))
}
cacheableRouter.Use(func(c *gin.Context) {
c.Header("Harness-FME-Proxy-Version", splitio.Version)
c.Header("Harness-FME-FlagSpec", options.SpecVersion)
c.Next()
})
authController.Register(cacheableRouter)
sdkController.Register(cacheableRouter)
eventsController.Register(regular, beacon)
Expand Down
10 changes: 9 additions & 1 deletion splitio/proxy/proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ import (
"testing"
"time"

"github.com/splitio/split-synchronizer/v5/splitio"
ilmock "github.com/splitio/split-synchronizer/v5/splitio/common/impressionlistener/mocks"
"github.com/splitio/split-synchronizer/v5/splitio/proxy/caching"
"github.com/splitio/split-synchronizer/v5/splitio/proxy/storage"
Expand Down Expand Up @@ -79,7 +80,8 @@ func TestSplitChangesEndpoints(t *testing.T) {
assert.Equal(t, "split2", changes.Splits[0].Name)
assert.False(t, changes.Splits[0].ImpressionsDisabled)
assert.Equal(t, "application/json; charset=utf-8", headers.Get("Content-Type"))

assert.Equal(t, opts.SpecVersion, headers.Get("Harness-FME-FlagSpec"))
assert.Equal(t, splitio.Version, headers.Get("Harness-FME-Proxy-Version"))
}

func TestSplitChangesWithFlagsetsCaching(t *testing.T) {
Expand Down Expand Up @@ -160,6 +162,8 @@ func TestSplitChangesWithFlagsetsCaching(t *testing.T) {
assert.Equal(t, int64(1), changes.Till)
assert.Equal(t, "split1", changes.Splits[0].Name)
assert.Equal(t, "application/json; charset=utf-8", headers.Get("Content-Type"))
assert.Equal(t, opts.SpecVersion, headers.Get("Harness-FME-FlagSpec"))
assert.Equal(t, splitio.Version, headers.Get("Harness-FME-Proxy-Version"))
}

func TestSegmentChangesAndMySegmentsEndpoints(t *testing.T) {
Expand Down Expand Up @@ -249,6 +253,8 @@ func TestSegmentChangesAndMySegmentsEndpoints(t *testing.T) {
assert.Equal(t, 200, status)
assert.Equal(t, []dtos.MySegmentDTO{}, segments)
assert.Equal(t, "application/json; charset=utf-8", headers.Get("Content-Type"))
assert.Equal(t, opts.SpecVersion, headers.Get("Harness-FME-FlagSpec"))
assert.Equal(t, splitio.Version, headers.Get("Harness-FME-Proxy-Version"))
}

func TestMembershipEndpoint(t *testing.T) {
Expand Down Expand Up @@ -284,6 +290,8 @@ func TestMembershipEndpoint(t *testing.T) {
assert.Equal(t, 200, status)
assert.Equal(t, expected, response)
assert.Equal(t, "application/json; charset=utf-8", headers.Get("Content-Type"))
assert.Equal(t, opts.SpecVersion, headers.Get("Harness-FME-FlagSpec"))
assert.Equal(t, splitio.Version, headers.Get("Harness-FME-Proxy-Version"))
}

func makeOpts() *Options {
Expand Down