Skip to content

POST /cart/add returns 401 → 403 with Clear-Site-Data header via local dev proxy #7568

@LucasBalbinoSS

Description

@LucasBalbinoSS

Bug Description

When running shopify theme dev, POST requests to /cart/add fail with:

  1. 401 Unauthorized (empty body)
  2. 403 Forbidden (HTML response: <!DOCTYPE ...)

The response to /cart/add includes an unusual Clear-Site-Data header, which appears to be terminating the session and causing the 401 → 403 cascade.

GET requests work normally. The cart works correctly when accessing the store via the preview URL (?preview_theme_id=).

Environment

  • CLI version: 3.94.3
  • Store: emaus-7331.myshopify.com
  • Development theme ID: 181626339439
  • OS: macOS

Steps to Reproduce

  1. Run shopify theme dev --store emaus-7331.myshopify.com
  2. Open the local preview at 127.0.0.1
  3. Try to add a product to the cart
  4. Observe POST /cart/add returning 401 (empty body) then 403 (HTML)

Already Tried

  • Updated CLI from 3.92.1 to 3.94.3
  • shopify auth logout + shopify auth login + restarted dev server
  • Cleared all CLI cache at ~/Library/Preferences/shopify-cli-*
  • Disabled store password protection
  • Problem persists in all cases

Expected Behavior

POST /cart/add should return a JSON response with cart data.

Actual Behavior

Returns 401 (empty body) then 403 (HTML with <!DOCTYPE) with Clear-Site-Data header on the response.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions