@@ -549,7 +549,7 @@ async fn run_server(config: Arc<Config>, query: Arc<Query>, rx: oneshot::Receive
549549 Response :: builder ( )
550550 . status ( err. 0 )
551551 . header ( "Content-Type" , "text/plain" )
552- . header ( "Server " , & * * VERSION_STRING )
552+ . header ( "X-Powered-By " , & * * VERSION_STRING )
553553 . body ( Body :: from ( err. 1 ) )
554554 . unwrap ( )
555555 } ) ;
@@ -720,7 +720,7 @@ fn handle_request(
720720 . status ( StatusCode :: OK )
721721 . header ( "Content-Type" , "application/octet-stream" )
722722 . header ( "Cache-Control" , format ! ( "public, max-age={:}" , TTL_LONG ) )
723- . header ( "Server " , & * * VERSION_STRING )
723+ . header ( "X-Powered-By " , & * * VERSION_STRING )
724724 . body ( Body :: from ( raw) )
725725 . unwrap ( ) )
726726 }
@@ -991,7 +991,7 @@ fn handle_request(
991991 . status ( StatusCode :: OK )
992992 . header ( "Content-Type" , content_type)
993993 . header ( "Cache-Control" , format ! ( "public, max-age={:}" , ttl) )
994- . header ( "Server " , & * * VERSION_STRING )
994+ . header ( "X-Powered-By " , & * * VERSION_STRING )
995995 . body ( body)
996996 . unwrap ( ) )
997997 }
@@ -1086,6 +1086,27 @@ fn handle_request(
10861086 ( & Method :: GET , Some ( & "mempool" ) , Some ( & "txids" ) , None , None , None ) => {
10871087 json_response ( query. mempool ( ) . txids ( ) , TTL_SHORT )
10881088 }
1089+ ( & Method :: GET , Some ( & "mempool" ) , Some ( & "txs" ) , Some ( & "all" ) , None , None ) => {
1090+ let txs = query
1091+ . mempool ( )
1092+ . txs ( )
1093+ . into_iter ( )
1094+ . map ( |tx| ( tx, None ) )
1095+ . collect ( ) ;
1096+
1097+ json_maybe_error_response ( prepare_txs ( txs, query, config) , TTL_SHORT )
1098+ }
1099+ ( & Method :: GET , Some ( & "mempool" ) , Some ( & "txs" ) , last_seen_txid, None , None ) => {
1100+ let last_seen_txid = last_seen_txid. and_then ( |txid| Txid :: from_hex ( txid) . ok ( ) ) ;
1101+ let txs = query
1102+ . mempool ( )
1103+ . txs_page ( 10_000 , last_seen_txid)
1104+ . into_iter ( )
1105+ . map ( |tx| ( tx, None ) )
1106+ . collect ( ) ;
1107+
1108+ json_maybe_error_response ( prepare_txs ( txs, query, config) , TTL_SHORT )
1109+ }
10891110 ( & Method :: GET , Some ( & "mempool" ) , Some ( & "recent" ) , None , None , None ) => {
10901111 let mempool = query. mempool ( ) ;
10911112 let recent = mempool. recent_txs_overview ( ) ;
@@ -1117,7 +1138,7 @@ fn handle_request(
11171138 // Disable caching because we don't currently support caching with query string params
11181139 . header ( "Cache-Control" , "no-store" )
11191140 . header ( "Content-Type" , "application/json" )
1120- . header ( "Server " , & * * VERSION_STRING )
1141+ . header ( "X-Powered-By " , & * * VERSION_STRING )
11211142 . header ( "X-Total-Results" , total_num. to_string ( ) )
11221143 . body ( Body :: from ( serde_json:: to_string ( & assets) ?) )
11231144 . unwrap ( ) )
@@ -1233,7 +1254,7 @@ where
12331254 . status ( status)
12341255 . header ( "Content-Type" , "text/plain" )
12351256 . header ( "Cache-Control" , format ! ( "public, max-age={:}" , ttl) )
1236- . header ( "Server " , & * * VERSION_STRING )
1257+ . header ( "X-Powered-By " , & * * VERSION_STRING )
12371258 . body ( message. into ( ) )
12381259 . unwrap ( ) )
12391260}
@@ -1243,7 +1264,7 @@ fn json_response<T: Serialize>(value: T, ttl: u32) -> Result<Response<Body>, Htt
12431264 Ok ( Response :: builder ( )
12441265 . header ( "Content-Type" , "application/json" )
12451266 . header ( "Cache-Control" , format ! ( "public, max-age={:}" , ttl) )
1246- . header ( "Server " , & * * VERSION_STRING )
1267+ . header ( "X-Powered-By " , & * * VERSION_STRING )
12471268 . body ( Body :: from ( value) )
12481269 . unwrap ( ) )
12491270}
@@ -1255,7 +1276,7 @@ fn json_maybe_error_response<T: Serialize>(
12551276 let response = Response :: builder ( )
12561277 . header ( "Content-Type" , "application/json" )
12571278 . header ( "Cache-Control" , format ! ( "public, max-age={:}" , ttl) )
1258- . header ( "Server " , & * * VERSION_STRING ) ;
1279+ . header ( "X-Powered-By " , & * * VERSION_STRING ) ;
12591280 Ok ( match value {
12601281 Ok ( v) => response
12611282 . body ( Body :: from ( serde_json:: to_string ( & v) ?) )
0 commit comments