Fix: Allow legacy headers in CORS (#3747)
Co-authored-by: Gerard Guillemas Martos <gerard@DESKTOP-6S0AS7R>
This commit is contained in:
parent
ab3582d057
commit
0985b1e18d
1 changed files with 13 additions and 1 deletions
|
@ -35,7 +35,7 @@ use http::header;
|
|||
use std::net::SocketAddr;
|
||||
use std::sync::Arc;
|
||||
use std::time::Duration;
|
||||
use surrealdb::headers::{DB, ID, NS};
|
||||
use surrealdb::headers::{AUTH_DB, AUTH_NS, DB, DB_LEGACY, ID, ID_LEGACY, NS, NS_LEGACY};
|
||||
use tokio_util::sync::CancellationToken;
|
||||
use tower::ServiceBuilder;
|
||||
use tower_http::add_extension::AddExtensionLayer;
|
||||
|
@ -106,6 +106,12 @@ pub async fn init(ct: CancellationToken) -> Result<(), Error> {
|
|||
NS.clone(),
|
||||
DB.clone(),
|
||||
ID.clone(),
|
||||
AUTH_NS.clone(),
|
||||
AUTH_DB.clone(),
|
||||
// TODO(gguillemas): Remove these headers once the legacy authentication is deprecated in v2.0.0
|
||||
NS_LEGACY.clone(),
|
||||
DB_LEGACY.clone(),
|
||||
ID_LEGACY.clone(),
|
||||
];
|
||||
|
||||
#[cfg(not(feature = "http-compression"))]
|
||||
|
@ -117,6 +123,12 @@ pub async fn init(ct: CancellationToken) -> Result<(), Error> {
|
|||
NS.clone(),
|
||||
DB.clone(),
|
||||
ID.clone(),
|
||||
AUTH_NS.clone(),
|
||||
AUTH_DB.clone(),
|
||||
// TODO(gguillemas): Remove these headers once the legacy authentication is deprecated in v2.0.0
|
||||
NS_LEGACY.clone(),
|
||||
DB_LEGACY.clone(),
|
||||
ID_LEGACY.clone(),
|
||||
];
|
||||
|
||||
let service = service
|
||||
|
|
Loading…
Reference in a new issue