Skip to content

Fix URL encoding in AMCP thumbnail commands to preserve path separators#1

Draft
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-thumbnail-url-encoding
Draft

Fix URL encoding in AMCP thumbnail commands to preserve path separators#1
Copilot wants to merge 4 commits intomasterfrom
copilot/fix-thumbnail-url-encoding

Conversation

Copy link

Copilot AI commented Jan 17, 2026

The url_encode function was encoding forward slashes as %2F, breaking file paths in AMCP thumbnail/media query commands.

Changes

  • src/protocol/util/http_request.cpp: Added / to unreserved characters in url_encode()
  • src/protocol/util/http_request.h: Added documentation clarifying the function is for path encoding

Example

Before:

http::url_encode("folder/file.png")  // "folder%2Ffile.png" - breaks path structure
"/thumbnail/" + encoded               // "/thumbnail/folder%2Ffile.png" - 404

After:

http::url_encode("folder/file.png")  // "folder/file.png" - preserves path
"/thumbnail/" + encoded               // "/thumbnail/folder/file.png" - works

Affects: THUMBNAIL RETRIEVE, THUMBNAIL GENERATE, CINF commands

Note: This function is only used for path components, not query parameters where / would need encoding.

Original prompt

On amcp, there is a url encoding error for thumbnail retrieve commands


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI changed the title [WIP] Fix URL encoding error for thumbnail retrieve commands Fix URL encoding in AMCP thumbnail commands to preserve path separators Jan 17, 2026
- Add url_encode_path() function to handle file paths properly
- Encode path components while preserving forward slash separators
- Support both Windows backslashes and Unix forward slashes
- Update AMCP commands: thumbnail_retrieve, thumbnail_generate, cinf
- Improve HTTP error messages with actual status codes
- Replace stringstream with direct string operations for better performance
- Follow RFC 3986 for URL encoding of unreserved characters

Fixes issue where file paths with spaces caused 404 errors in
thumbnail retrieval and other media-scanner HTTP requests.
@dedicatedbroadcastsolutions dedicatedbroadcastsolutions force-pushed the copilot/fix-thumbnail-url-encoding branch from a469e90 to 0d53f1b Compare January 17, 2026 01:14
Debian package versions don't allow underscores. Update the workflow to replace underscores (along with slashes and spaces) with hyphens when generating the build version from the branch name.
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.

2 participants