Skip to content

Support spaces and special characters - #3

Merged
carllapierre merged 4 commits into
carllapierre:mainfrom
Amitabitbul:main
Dec 8, 2025
Merged

carllapierre merged 4 commits into
carllapierre:mainfrom
Amitabitbul:main

Conversation

@Amitabitbul

Copy link
Copy Markdown
Contributor

This pull request improves how prompt names and labels are encoded when making API requests in the LangfuseClient, ensuring correct handling of spaces and special characters. It also updates the documentation to reflect these changes and adds comprehensive unit tests to verify correct encoding behavior.

Prompt encoding improvements:

  • Replaced usage of HttpUtility.UrlEncode with Uri.EscapeDataString for encoding prompt names and labels in BuildPromptPath, ensuring better handling of spaces and special characters. (src/Langfuse.Client/LangfuseClient.cs, [1] [2]

Documentation updates:

  • Updated XML documentation for GetPromptAsync and related methods to clarify support for names and labels with spaces and special characters. (src/Langfuse.Client/LangfuseClient.cs, [1] [2]

Testing enhancements:

Copilot AI and others added 4 commits December 8, 2025 13:18
- Replace HttpUtility.UrlEncode with Uri.EscapeDataString for path segments
- Add comprehensive unit tests for prompt names with spaces
- Update XML documentation to indicate support for spaces

Co-authored-by: Amitabitbul <2770691+Amitabitbul@users.noreply.github.com>
- Extract mock response creation into helper method
- Extract client setup into helper method
- Simplify test assertions

Co-authored-by: Amitabitbul <2770691+Amitabitbul@users.noreply.github.com>
…-encoding

Fix URL encoding for prompt names with spaces in GetPromptAsync

@carllapierre carllapierre left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing!

@carllapierre
carllapierre merged commit 0904685 into carllapierre:main Dec 8, 2025
6 checks passed
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 this pull request may close these issues.

3 participants