A decentralized music tracking and discovery platform built on AT Protocol 🎵
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Add actix-cors and enable permissive CORS

+25
+17
Cargo.lock
··· 20 20 ] 21 21 22 22 [[package]] 23 + name = "actix-cors" 24 + version = "0.7.1" 25 + source = "registry+https://github.com/rust-lang/crates.io-index" 26 + checksum = "daa239b93927be1ff123eebada5a3ff23e89f0124ccb8609234e5103d5a5ae6d" 27 + dependencies = [ 28 + "actix-utils", 29 + "actix-web", 30 + "derive_more 2.0.1", 31 + "futures-util", 32 + "log", 33 + "once_cell", 34 + "smallvec", 35 + ] 36 + 37 + [[package]] 23 38 name = "actix-http" 24 39 version = "3.11.1" 25 40 source = "registry+https://github.com/rust-lang/crates.io-index" ··· 5051 5066 name = "rocksky-scrobbler" 5052 5067 version = "0.1.0" 5053 5068 dependencies = [ 5069 + "actix-cors", 5054 5070 "actix-limitation", 5055 5071 "actix-session 0.10.1", 5056 5072 "actix-web", ··· 5143 5159 name = "rocksky-webscrobbler" 5144 5160 version = "0.1.0" 5145 5161 dependencies = [ 5162 + "actix-cors", 5146 5163 "actix-limitation", 5147 5164 "actix-session 0.10.1", 5148 5165 "actix-web",
+1
crates/scrobbler/Cargo.toml
··· 42 42 tokio-stream = { version = "0.1.17", features = ["full"] } 43 43 tracing = "0.1.41" 44 44 nanoid = "0.4.0" 45 + actix-cors = "0.7.1" 45 46 46 47 [dev-dependencies] 47 48 serial_test = "3.0.0"
+3
crates/scrobbler/src/lib.rs
··· 16 16 17 17 use std::{env, sync::Arc, time::Duration}; 18 18 19 + use actix_cors::Cors; 19 20 use actix_limitation::{Limiter, RateLimiter}; 20 21 use actix_session::SessionExt; 21 22 use actix_web::{ ··· 79 80 let mb_client = Arc::new(mb_client); 80 81 81 82 HttpServer::new(move || { 83 + let cors = Cors::permissive(); 82 84 App::new() 83 85 .wrap(RateLimiter::default()) 86 + .wrap(cors) 84 87 .app_data(limiter.clone()) 85 88 .app_data(Data::new(conn.clone())) 86 89 .app_data(Data::new(cache.clone()))
+1
crates/webscrobbler/Cargo.toml
··· 40 40 actix-limitation = "0.5.1" 41 41 tracing = "0.1.41" 42 42 nanoid = "0.4.0" 43 + actix-cors = "0.7.1" 43 44 44 45 [dev-dependencies] 45 46 serial_test = "3.0.0"
+3
crates/webscrobbler/src/lib.rs
··· 1 1 use std::{env, sync::Arc, time::Duration}; 2 2 3 + use actix_cors::Cors; 3 4 use actix_limitation::{Limiter, RateLimiter}; 4 5 use actix_session::SessionExt; 5 6 use actix_web::{ ··· 67 68 ); 68 69 69 70 HttpServer::new(move || { 71 + let cors = Cors::permissive(); 70 72 App::new() 71 73 .wrap(RateLimiter::default()) 74 + .wrap(cors) 72 75 .app_data(limiter.clone()) 73 76 .app_data(Data::new(conn.clone())) 74 77 .app_data(Data::new(cache.clone()))