Skip to content

chore: strip api endpoint#114

Merged
Kikobeats merged 1 commit into
masterfrom
next
Jun 17, 2026
Merged

chore: strip api endpoint#114
Kikobeats merged 1 commit into
masterfrom
next

Conversation

@Kikobeats

@Kikobeats Kikobeats commented Jun 17, 2026

Copy link
Copy Markdown
Member

Note

Medium Risk
Changes how pasted URLs and query strings are parsed before API calls; behavior shifts for localhost and non-API URLs, though covered by new tests.

Overview
normalizeInput now takes the binary’s endpoint flag and only strips API hosts when the paste looks like Microlink API input, not every URL-shaped string.

Pasted *.microlink.io URLs are always normalized (any binary). Dev/next hosts (e.g. localhost:3000, next.microlink.io) are stripped only when that binary’s endpoint matches, with a host-boundary regex so similar hosts (e.g. localhost:30001) are not mangled. Bare target URLs stay unchanged; prod without an endpoint no longer auto-strips localhost.

Query handling after host removal lifts the url= value to the front so other params keep working regardless of order. IPv4/IPv6 local-address blanket stripping was removed in favor of endpoint-scoped behavior. fetch passes endpoint into normalizeInput; tests cover trailing slashes, param order, and cross-binary pastes.

Reviewed by Cursor Bugbot for commit 761de68. Bugbot is set up for automated code reviews on this repo. Configure here.

@Kikobeats Kikobeats changed the title chore: stripe api endpoint chore: strip api endpoint Jun 17, 2026

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit 465cc3a. Configure here.

Comment thread src/api.js Outdated
@coveralls

coveralls commented Jun 17, 2026

Copy link
Copy Markdown

Coverage Report for CI Build 27700099483

Warning

No base build found for commit 429eeec on master.
Coverage changes can't be calculated without a base build.
If a base build is processing, this comment will update automatically when it completes.

Coverage: 97.784%

Details

  • Patch coverage: 2 uncovered changes across 1 file (54 of 56 lines covered, 96.43%).

Uncovered Changes

File Changed Covered %
src/api.js 56 54 96.43%

Coverage Regressions

Requires a base build to compare against. How to fix this →


Coverage Stats

Coverage Status
Relevant Lines: 548
Covered Lines: 546
Line Coverage: 99.64%
Relevant Branches: 129
Covered Branches: 116
Branch Coverage: 89.92%
Branches in Coverage %: Yes
Coverage Strength: 4.95 hits per line

💛 - Coveralls

@Kikobeats Kikobeats merged commit f16cd98 into master Jun 17, 2026
2 checks passed
@Kikobeats Kikobeats deleted the next branch June 17, 2026 15:26
@Kikobeats Kikobeats restored the next branch July 1, 2026 12:03
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