[PR #6877] [CLOSED] fix: support expo-origin header for origin validation #32540

Closed
opened 2026-04-17 23:20:05 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/6877
Author: @bytaesu
Created: 12/19/2025
Status: Closed

Base: canaryHead: 2025-12-19/fix/expo-origin-header-support


📝 Commits (3)

  • 9d989ad fix: supoort expo-origin header for origin validation
  • 1bd8ff4 test: add test cases for expo-origin header support
  • 1db6219 Merge branch 'canary' into 2025-12-19/fix/expo-origin-header-support

📊 Changes

2 files changed (+116 additions, -1 deletions)

View changed files

📝 packages/better-auth/src/api/middlewares/origin-check.test.ts (+97 -0)
📝 packages/better-auth/src/api/middlewares/origin-check.ts (+19 -1)

📄 Description

Related issue comment - https://github.com/better-auth/better-auth/issues/6798#issuecomment-3662482162


Summary by cubic

Adds support for the expo-origin header in origin validation so Expo clients pass origin checks. Falls back to expo-origin when Origin is missing, while still preferring Origin when present.

  • Bug Fixes
    • Accept expo-origin when Origin/Referer are absent.
    • Precedence: Origin > Referer > expo-origin.
    • Tests cover trusted expo-origin, Origin preference, and 403 on untrusted expo-origin.

Written for commit 1db6219d06. Summary will update automatically on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/6877 **Author:** [@bytaesu](https://github.com/bytaesu) **Created:** 12/19/2025 **Status:** ❌ Closed **Base:** `canary` ← **Head:** `2025-12-19/fix/expo-origin-header-support` --- ### 📝 Commits (3) - [`9d989ad`](https://github.com/better-auth/better-auth/commit/9d989ad44a809dc9413c1daafaae16c8df89b2d9) fix: supoort expo-origin header for origin validation - [`1bd8ff4`](https://github.com/better-auth/better-auth/commit/1bd8ff4d0533c6832670e28647063a436d4f7377) test: add test cases for expo-origin header support - [`1db6219`](https://github.com/better-auth/better-auth/commit/1db6219d06f465ecb7915beedd01d47cdb1bf370) Merge branch 'canary' into 2025-12-19/fix/expo-origin-header-support ### 📊 Changes **2 files changed** (+116 additions, -1 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/api/middlewares/origin-check.test.ts` (+97 -0) 📝 `packages/better-auth/src/api/middlewares/origin-check.ts` (+19 -1) </details> ### 📄 Description Related issue comment - https://github.com/better-auth/better-auth/issues/6798#issuecomment-3662482162 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Adds support for the expo-origin header in origin validation so Expo clients pass origin checks. Falls back to expo-origin when Origin is missing, while still preferring Origin when present. - **Bug Fixes** - Accept expo-origin when Origin/Referer are absent. - Precedence: Origin > Referer > expo-origin. - Tests cover trusted expo-origin, Origin preference, and 403 on untrusted expo-origin. <sup>Written for commit 1db6219d06f465ecb7915beedd01d47cdb1bf370. Summary will update automatically on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-17 23:20:05 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#32540