Conversation
A URL like https://cdn.microlink.io/file-examples/sample.docx was having its host stripped as if it were an API endpoint, leaving an invalid bare path (file-examples/sample.docx → EINVALURLCLIENT). Host stripping now only runs for API-shaped input, which always carries a `url=` query. A bare target URL on a microlink.io content host (cdn, etc.) has none, so it is left untouched. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Coverage Report for CI Build 28516181973Warning No base build found for commit Coverage: 97.801%Details
Uncovered ChangesNo uncovered changes found. Coverage RegressionsRequires a base build to compare against. How to fix this → Coverage Stats
💛 - Coveralls |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
The CLI stripped the
cdn.microlink.iohost as if it were an API endpoint, leaving an invalid bare path.Cause
normalizeInputstripped any*.microlink.iohost unconditionally, so a plain content URL (cdn, etc.) lost its host.Fix
Host stripping now only runs for API-shaped input, which always carries a
url=query. A bare target URL on a microlink.io content host has none, so it survives untouched. All existing normalization cases (API paste, endpoint stripping, port-prefix safety) are preserved; added tests for the content-host case.🤖 Generated with Claude Code
Note
Low Risk
Small, test-backed change to CLI input normalization with no auth or data-path impact; existing API-paste cases remain covered by tests.
Overview
Fixes the CLI rejecting bare
https://cdn.microlink.io/...targets becausenormalizeInputstripped any*.microlink.iohost as if the paste were an API URL.Host stripping (microlink API host + binary
endpointhost) now runs only when the input is API-shaped—it contains aurl=query ((?:^|[?&])url=). Plain target URLs, including microlink content hosts, stay unchanged; pastedapi.microlink.io/?url=…behavior is unchanged.Tests cover
cdn.microlink.iowith and without a devendpointand trailing&pdf=true-style flags.Reviewed by Cursor Bugbot for commit c3db5ad. Bugbot is set up for automated code reviews on this repo. Configure here.