`--tunnel-url` strips app path

I have reproduced the issue on the latest CLI version.

Yes, I am on the latest version

I have searched existing posts and this report is not a duplicate.

Yes, this isn’t a duplicate

In which of these areas are you experiencing a problem?

Other

Expected behavior

The Shopify embedded app templates always put the app at /app.

With application_url = "https://example.com/app", when you pass --tunnel-url https://mytunnel.com:8080, Shopify tries to load https://mytunnel.com inside the iframe. That doesn’t work, since the app bridge is only available at /app.

Actual behavior

Shopify should try to load https://mytunnel.com/app inside the iframe. The application URL path should be preserved.

Reproduction steps

  1. Configure application_url to include the pathname /app
  2. Run shopify app dev with --tunnel-url
  3. Try to open the app

Verbose output

N/A

Just look at the tests in the repository, there don’t appear to be any tests for an application_url that ends in /app

Operating system

Ubuntu 26.04

CLI version

4.6.1