Skip to content

Commit

Permalink
worker: allows cors for pobarchives.com
Browse files Browse the repository at this point in the history
  • Loading branch information
Dav1dde committed Jul 24, 2024
1 parent 6c08d5b commit 3c93f0f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions worker/src/consts.rs
Original file line number Diff line number Diff line change
Expand Up @@ -27,3 +27,4 @@ pub const CACHE_A_BIT: Duration = Duration::from_secs(21600); // 6 Hours
pub const CACHE_FOREVER: Duration = Duration::from_secs(31536000);

pub const CORS_POB_API: &[&str] = &["https://pob.cool"];
pub const CORS_READ_API: &[&str] = &["https://pobarchives.com"];
1 change: 1 addition & 0 deletions worker/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,7 @@ async fn cors(rctx: &mut RequestContext) -> Response {
let origin = match rctx.route() {
Api(Get(PobPaste(_) | PobUserPaste(_, _))) => matches(consts::CORS_POB_API),
Api(Post(PobUpload)) => matches(consts::CORS_POB_API),
Api(Get(Paste(_) | UserPaste(_, _))) => matches(consts::CORS_READ_API),
_ => None,
};

Expand Down

0 comments on commit 3c93f0f

Please sign in to comment.