Skip to content

Commit

Permalink
Added CORS headers to proxy_anthropic (#8)
Browse files Browse the repository at this point in the history
  • Loading branch information
vishalkrishnads authored Jul 31, 2024
1 parent 952cfe7 commit 9cff9ee
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/handlers/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ pub async fn proxy_anthropic(
Ok(response) => {
let status = response.status();
let body = response.bytes().await.unwrap_or_default();
HttpResponse::build(status).body(body)
HttpResponse::build(status)
.header("Access-Control-Allow-Origin", "https://zitefy.com")
.header("Access-Control-Allow-Methods", "POST, OPTIONS")
.header("Access-Control-Allow-Headers", "Content-Type, Authorization")
.body(body)
},
Err(e) => HttpResponse::InternalServerError().body(format!("Error: {}", e)),
}
Expand Down

0 comments on commit 9cff9ee

Please sign in to comment.