Skip to content

fix: return 410 Gone instead of 301 for deprecated registerDevice#172

Open
jakebromberg wants to merge 2 commits intomainfrom
fix/27-register-device-status
Open

fix: return 410 Gone instead of 301 for deprecated registerDevice#172
jakebromberg wants to merge 2 commits intomainfrom
fix/27-register-device-status

Conversation

@jakebromberg
Copy link
Member

Summary

  • The deprecated registerDevice endpoint (POST /request/register) was returning HTTP 301 (Moved Permanently), which is a redirect status — browsers follow the Location header rather than reading the JSON body.
  • Changed to HTTP 410 (Gone) to correctly signal the endpoint is retired.
  • Added unit tests for the handler covering status code, response body, and env fallback.

Test plan

  • Unit test asserts response status is 410 (verified it fails with 301 before the fix)
  • Unit test asserts the deprecation JSON body with correct replacement endpoint
  • Unit test verifies fallback to localhost:8082 when BETTER_AUTH_URL is unset

Fixes #27

Made with Cursor

301 Moved Permanently is a redirect status that browsers follow via
Location header. 410 Gone correctly signals the endpoint is retired.

Co-authored-by: Cursor <cursoragent@cursor.com>
@jakebromberg jakebromberg force-pushed the fix/27-register-device-status branch from 6f33938 to aa65684 Compare February 27, 2026 05:55
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant