Shopify / Shopify/liquid

Incorrect request object in 404 handler

Open
#1,714 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Ruby
Stars
11.9k
Forks
1.5k
Avg merge
17h 55m
Merged PRs (30d)
3

Description

When using the 404 template, the request object does not contain the URL shown in the browser's address bar. Instead, it refers to /404.

Therefore, it's impossible to use request.path, request.url, etc to identify the "not found" page. In fact, that URL doesn't appear anywhwere in any section of the page, including the HEAD tag.

Please provide this information, so that it can be used in Liquid. Specifically, I would like to create a HTTP 301 redirect based on this information, so would love to know how this can be done, and if it's not possible, have it enabled.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by tracing how the 404 template receives its request object and how request.path and request.url are exposed to Liquid. Reproduce a not-found page and compare the browser URL with the request values available in the template. Done means the original URL is available for a 301 redirect, with coverage for 404 rendering.

Written by the indexing model from the issue text.

Assessment

Tech stack
ruby
Domain
backend
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.