Skip to content

go-feature-flag server provider overwrites pathname #1321

Open
@sampterson

Description

@sampterson

Description

The go-feature-flag-provider overwrites the endpoint path name when constructing the endpointURL. When using a relay-proxy deployed behind a load balancer that proxies traffic based on pathname, the provider is not able to send requests to the proper url.

Example provider config:

const goFeatureFlagProvider: GoFeatureFlagProvider = new GoFeatureFlagProvider( { endpoint: https://int-lb-url.com/relay-proxy, } ); OpenFeature.setProvider(goFeatureFlagProvider);

I would expect requests for flag evaluate to be requested from: https://int-lb-url.com/relay-proxy/v1/feature/${flagKey}/eval

Instead they are being requested from: https://int-lb-url.com/v1/feature/${flagKey}/eval

Possible Cause

In the GoffApiController, the built URL is overwriting the pathname of the URL.

https://github.com/open-feature/js-sdk-contrib/blob/main/libs/providers/go-feature-flag/src/lib/controller/goff-api.ts#L64

This is not the same behavior used in the go-feature-flag-web provider, which appends the relay-proxy pathnames to any existing base endpoint provider to the provider.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions