@timber-js/app 0.2.0-alpha.104 → 0.2.0-alpha.106

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1814,7 +1814,8 @@ async function runRenderPhase(config, req, match, responseHeaders, requestHeader
1814
1814
  */
1815
1815
  async function handleRequest(config, req, method, path) {
1816
1816
  const stripTrailingSlash = config.stripTrailingSlash ?? true;
1817
- const result = canonicalize(new URL(req.url).pathname, stripTrailingSlash);
1817
+ const url = new URL(req.url);
1818
+ const result = canonicalize(url.pathname, stripTrailingSlash);
1818
1819
  if (!result.ok) return new Response(null, { status: result.status });
1819
1820
  const canonicalPathname = result.pathname;
1820
1821
  if (config.matchMetadataRoute) {
@@ -1881,6 +1882,7 @@ async function handleRequest(config, req, method, path) {
1881
1882
  }
1882
1883
  }
1883
1884
  if (!match) {
1885
+ if (isDebug()) console.warn(`[timber] No route matched for pathname: ${canonicalPathname}\n Raw URL: ${url.pathname}\n Method: ${method}`);
1884
1886
  if (config.renderNoMatch) {
1885
1887
  const responseHeaders = new Headers();
1886
1888
  return cloneWithMutableHeaders(await config.renderNoMatch(req, responseHeaders));