Skip to content

Remove trailing periods from URLs in terminal output#14105

Open
dario-piotrowicz wants to merge 1 commit into
mainfrom
dario/14102/remote-periods-from-urls
Open

Remove trailing periods from URLs in terminal output#14105
dario-piotrowicz wants to merge 1 commit into
mainfrom
dario/14102/remote-periods-from-urls

Conversation

@dario-piotrowicz
Copy link
Copy Markdown
Member

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

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
Copy link
Copy Markdown

changeset-bot Bot commented May 29, 2026

🦋 Changeset detected

Latest commit: 93fe913

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
Copy link
Copy Markdown
Contributor

Codeowners approval required for this PR:

  • @cloudflare/wrangler
Show detailed file reviewers
  • .changeset/fix-trailing-period-urls.md: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/tests/utils/agent-prompt.test.ts: [@cloudflare/wrangler]
  • packages/local-explorer-ui/src/utils/agent-prompt.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/http/fetch.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/runtime/structured-logs.ts: [@cloudflare/wrangler]
  • packages/miniflare/src/workers/email/validate.ts: [@cloudflare/wrangler]
  • packages/miniflare/test/plugins/email/index.spec.ts: [@cloudflare/wrangler]
  • packages/vitest-pool-workers/src/worker/entrypoints.ts: [@cloudflare/wrangler]
  • packages/workers-utils/src/tunnel.ts: [@cloudflare/wrangler]
  • packages/workers-utils/tests/tunnel.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/core.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/tests/deploy/formats.test.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/api/startDevWorker/ConfigController.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deployment-bundle/esbuild-plugins/cloudflare-internal.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deployment-bundle/esbuild-plugins/hybrid-nodejs-compat.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/deployment-bundle/esbuild-plugins/nodejs-compat.ts: [@cloudflare/wrangler]
  • packages/wrangler/src/user/whoami.ts: [@cloudflare/wrangler]

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 29, 2026

✅ All changesets look good

@ask-bonk
Copy link
Copy Markdown
Contributor

ask-bonk Bot commented May 29, 2026

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

Copy link
Copy Markdown
Contributor

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

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
Copy link
Copy Markdown

pkg-pr-new Bot commented May 29, 2026

create-cloudflare

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

@cloudflare/deploy-helpers

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

@cloudflare/kv-asset-handler

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

miniflare

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

@cloudflare/pages-shared

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

@cloudflare/unenv-preset

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

@cloudflare/vite-plugin

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

@cloudflare/vitest-pool-workers

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

@cloudflare/workers-editor-shared

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

@cloudflare/workers-utils

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

wrangler

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

@cloudflare/wrangler-bundler

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

commit: 93fe913

@dario-piotrowicz dario-piotrowicz force-pushed the dario/14102/remote-periods-from-urls branch from 95fbc02 to 93fe913 Compare May 29, 2026 11:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Untriaged

Development

Successfully merging this pull request may close these issues.

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

2 participants