Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Identities are not correctly URL encoded #124

Open
mjwills-k opened this issue Nov 12, 2024 · 2 comments · May be fixed by #126
Open

Identities are not correctly URL encoded #124

mjwills-k opened this issue Nov 12, 2024 · 2 comments · May be fixed by #126

Comments

@mjwills-k
Copy link

mjwills-k commented Nov 12, 2024

The below code generates an identity of ZZGGHH_abc rather than the expected ZZGGHH_abc&h=g. I suspect some of your code is not correctly url encoding inputs.

Note that the code does work if you pass in traits. So I suspect

url += $"?identifier={identity}{(transient ? $"&transient={transient}" : "")}";
needs fixing, but not
jsonBody = JsonConvert.SerializeObject(new { identifier = identity, traits, transient });
.

using Flagsmith;

namespace TestsForFlagSmith
{
    public class IssueForFlagSmith : TestsCommon
    {
        protected static readonly Lazy<FlagsmithClient> _flagsmithClient = new Lazy<FlagsmithClient>(() => new FlagsmithClient("keyhere"));

        [Test]
        public async Task CorrectIdentityIsGenerated()
        {
            var identity = "ZZGGHH_abc&h=g";

            var flags = await _flagsmithClient.Value.GetIdentityFlags(identity);
        }
    }
}
@matthewelwell
Copy link
Contributor

Thanks for raising this @mjwills-k - we'd gratefully receive a PR to fix this.

@mjwills-k
Copy link
Author

@matthewelwell matthewelwell linked a pull request Dec 12, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants