Skip to content

Remove trailing periods from URLs in terminal output#14105

Merged
dario-piotrowicz merged 3 commits into
mainfrom
dario/14102/remote-periods-from-urls
Jun 1, 2026
Merged

Remove trailing periods from URLs in terminal output#14105
dario-piotrowicz merged 3 commits into
mainfrom
dario/14102/remote-periods-from-urls

Conversation

@dario-piotrowicz

@dario-piotrowicz dario-piotrowicz commented May 29, 2026

Copy link
Copy Markdown
Member

Fixes #14102

URLs printed to the terminal with a sentence-ending period (e.g. https://example.com/path.) would include the period when clicked in some terminal emulators, causing 404 errors. This removes trailing periods from all URLs displayed in CLI output across wrangler, miniflare, vitest-pool-workers, and workers-utils.


  • Tests
    • Tests included/updated
    • Automated tests not possible - manual testing has been completed as follows:
    • Additional testing not necessary because:
  • Public documentation
    • Cloudflare docs PR(s):
    • Documentation not necessary because: self explanatory fix

A picture of a cute animal (not mandatory, but encouraged)


Open in Devin Review

@changeset-bot

changeset-bot Bot commented May 29, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 9dc32b1

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 8 packages
Name Type
wrangler Patch
miniflare Patch
@cloudflare/vitest-pool-workers Patch
@cloudflare/workers-utils Patch
@cloudflare/vite-plugin Patch
@cloudflare/wrangler-bundler Patch
@cloudflare/pages-shared Patch
@cloudflare/cli-shared-helpers Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@github-project-automation github-project-automation Bot moved this to Untriaged in workers-sdk May 29, 2026
@workers-devprod workers-devprod requested review from a team and emily-shen and removed request for a team May 29, 2026 11:46
@workers-devprod

workers-devprod commented May 29, 2026

Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • ✅ @cloudflare/wrangler
Show detailed file reviewers

@github-actions

github-actions Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

✅ All changesets look good

@ask-bonk

ask-bonk Bot commented May 29, 2026

Copy link
Copy Markdown
Contributor

Now let me check the no publicURL, no extendHint branch — the original code said "The tunnel is still open at ${publicURL}. It expires in ...". Looking at line 151, when there's no publicURL, the period is still there at the end of the sentence: "The tunnel is still open. It expires in ${formatTunnelDuration(remainingMs)}." — that's fine because there's no URL ending with a period here.

Now let me check if the vitest-pool-workers URL change is correct — the original URL had a period at the end but the new one has a trailing slash:

https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ — original was migrate-to-module-workers. (period removed), new is migrate-to-module-workers/ (trailing slash added). Wait, let me re-read the diff more carefully.

Looking at the diff for packages/vitest-pool-workers/src/worker/entrypoints.ts:

-			"If you're using service workers, please migrate to the modules format: https://developers.cloudflare.com/workers/reference/migrate-to-module-workers.";
+			"If you're using service workers, please migrate to the modules format: https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/";

The original URL was migrate-to-module-workers. — that period was a sentence-ending period, not part of the URL. The new version is migrate-to-module-workers/ — this added a trailing slash that wasn't there before. Wait, actually the original URL path was migrate-to-module-workers and the . was the sentence punctuation. The new URL is migrate-to-module-workers/ with a trailing slash. That slash wasn't in the original URL — so the URL itself was changed, not just the period removed.

Let me check if the Cloudflare docs URL actually works with or without the trailing slash:

Actually, looking more carefully at the original:

https://developers.cloudflare.com/workers/reference/migrate-to-module-workers.

The . at the end is the sentence period. The actual URL is https://developers.cloudflare.com/workers/reference/migrate-to-module-workers (no trailing slash). The new version has https://developers.cloudflare.com/workers/reference/migrate-to-module-workers/ with a trailing slash added. This is a URL change, not just removing a period. However, Cloudflare docs typically work with or without trailing slashes (they redirect), so this isn't a functional bug.

Let me also verify the miniflare/src/http/fetch.ts change — the error message still has a period at the end of the second sentence:

`Fetch API cannot load: ${url.toString()}\nMake sure you're using http(s):// URLs for WebSocket requests via fetch.`

The first period (after url.toString()) was removed, which is the fix. The second period (after via fetch) remains, which is correct since it's not after a URL. Good.

Now let me look at the structured-logs.ts change:

-						"See https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist.";
+						"See https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist";

Wait — vc-redist is the end of the URL path. The . was the sentence period. But vc-redist — is the actual Microsoft URL vc-redist or vc-redist? Let me check if there's a file extension or anything. The URL https://learn.microsoft.com/en-us/cpp/windows/latest-supported-vc-redist should work fine.

Overall, this PR looks straightforward and correct. The one thing I want to flag is the tunnel.ts refactoring which goes beyond just removing periods — it restructured the message to move the URL to the end of the string. Let me check if there's a subtle issue with the test expectation at line 390:

"Tunnel still open, expires in 1m: https://my-tunnel.trycloudflare.com Press [t] to extend by 1 hour."

The URL https://my-tunnel.trycloudflare.com is followed by a space and then Press [t] to extend by 1 hour.. Terminal emulators typically break URL detection on whitespace, so the URL won't include the hint text. This is fine.

But actually, there IS an issue here. The hint Press [t] to extend by 1 hour. ends with a period. If a terminal emulator is trying to detect URLs in this entire string, the URL in the middle is fine. But the original PR goal is about removing trailing periods from URLs. In this refactored case, the URL is no longer at the end, so the period problem doesn't apply. However, the resulting message formatting lacks a separator between the URL and the hint:

Tunnel still open, expires in 1m: https://my-tunnel.trycloudflare.com Press [t] to extend by 1 hour.

Some terminal emulators are smarter about URL detection and might not break cleanly on the space. But most modern ones do. This is a minor concern.

Let me check one more thing — the no-extendHint case with a URL. Looking at line 432 in the test:

"Tunnel still open, expires in 1m: https://my-tunnel.trycloudflare.com"

The URL is at the end with no trailing period.

And now the no-URL case with the period still present at line 151:

`The tunnel is still open. It expires in ${formatTunnelDuration(remainingMs)}.`

This has periods but no URLs — correct, no issue.

Overall, this PR is clean. The changes are mechanical period removals. The tunnel.ts refactoring is a bit more involved but the approach of moving the URL to the end of the message (instead of having it followed by a period) is a reasonable alternative to just removing the period. The only very minor observation is that the vitest-pool-workers change added a trailing slash to the URL that wasn't there before, but that's not a functional issue.

LGTM

github run

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

@pkg-pr-new

pkg-pr-new Bot commented May 29, 2026

Copy link
Copy Markdown
create-cloudflare

npm i https://pkg.pr.new/create-cloudflare@14105

@cloudflare/deploy-helpers

npm i https://pkg.pr.new/@cloudflare/deploy-helpers@14105

@cloudflare/kv-asset-handler

npm i https://pkg.pr.new/@cloudflare/kv-asset-handler@14105

miniflare

npm i https://pkg.pr.new/miniflare@14105

@cloudflare/pages-shared

npm i https://pkg.pr.new/@cloudflare/pages-shared@14105

@cloudflare/unenv-preset

npm i https://pkg.pr.new/@cloudflare/unenv-preset@14105

@cloudflare/vite-plugin

npm i https://pkg.pr.new/@cloudflare/vite-plugin@14105

@cloudflare/vitest-pool-workers

npm i https://pkg.pr.new/@cloudflare/vitest-pool-workers@14105

@cloudflare/workers-editor-shared

npm i https://pkg.pr.new/@cloudflare/workers-editor-shared@14105

@cloudflare/workers-utils

npm i https://pkg.pr.new/@cloudflare/workers-utils@14105

wrangler

npm i https://pkg.pr.new/wrangler@14105

@cloudflare/wrangler-bundler

npm i https://pkg.pr.new/@cloudflare/wrangler-bundler@14105

commit: 9dc32b1

@dario-piotrowicz dario-piotrowicz force-pushed the dario/14102/remote-periods-from-urls branch 3 times, most recently from 819017d to c2e9846 Compare May 31, 2026 16:26

@workers-devprod workers-devprod left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Codeowners reviews satisfied

@github-project-automation github-project-automation Bot moved this from Untriaged to Approved in workers-sdk Jun 1, 2026
@dario-piotrowicz dario-piotrowicz force-pushed the dario/14102/remote-periods-from-urls branch from c2e9846 to a01131e Compare June 1, 2026 12:27
@dario-piotrowicz dario-piotrowicz enabled auto-merge (squash) June 1, 2026 15:35
@dario-piotrowicz dario-piotrowicz merged commit 337e912 into main Jun 1, 2026
52 of 53 checks passed
@dario-piotrowicz dario-piotrowicz deleted the dario/14102/remote-periods-from-urls branch June 1, 2026 15:39
@github-project-automation github-project-automation Bot moved this from Approved to Done in workers-sdk Jun 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

wrangler whoami output: Trailing period after api-token url causes 404

3 participants