Fix test for NIP-86 Relay Management API (Content-Type, not Accept)

This commit is contained in:
Mike Dilger 2025-01-30 10:16:04 +13:00
parent 2340085832
commit 52e1b49823
No known key found for this signature in database
GPG Key ID: 47581A78D4329BA4

View File

@ -33,12 +33,18 @@ pub async fn serve_http(
return Ok(response);
}
// check for Accept header of application/nostr+json
// Check if it is a NIP-11 request
if let Some(accept) = request.headers().get("Accept") {
if let Ok(s) = accept.to_str() {
if s == "application/nostr+json" {
return nip11::serve_nip11(peer).await;
}
}
}
// Check if it is a NIP-86 Relay Management request
if let Some(content_type) = request.headers().get("Content-Type") {
if let Ok(s) = content_type.to_str() {
if s == "application/nostr+json+rpc" {
return management::handle(peer, request).await;
}