feature: add new mikan scrapers
This commit is contained in:
@@ -27,10 +27,10 @@ async fn graphql_handler(
|
||||
|
||||
// 检查是否是 introspection 查询
|
||||
fn is_introspection_query(req: &async_graphql::Request) -> bool {
|
||||
if let Some(operation) = &req.operation_name {
|
||||
if operation.starts_with("__") {
|
||||
return true;
|
||||
}
|
||||
if let Some(operation) = &req.operation_name
|
||||
&& operation.starts_with("__")
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
// 检查查询内容是否包含 introspection 字段
|
||||
|
||||
@@ -97,15 +97,14 @@ where
|
||||
let res_fut = async move {
|
||||
let response = future.await?;
|
||||
let etag_from_response = response.headers().get(ETAG).cloned();
|
||||
if let Some(etag_in_request) = ifnm {
|
||||
if let Some(etag_from_response) = etag_from_response {
|
||||
if etag_in_request == etag_from_response {
|
||||
return Ok(Response::builder()
|
||||
.status(StatusCode::NOT_MODIFIED)
|
||||
.body(Body::empty())
|
||||
.unwrap());
|
||||
}
|
||||
}
|
||||
if let Some(etag_in_request) = ifnm
|
||||
&& let Some(etag_from_response) = etag_from_response
|
||||
&& etag_in_request == etag_from_response
|
||||
{
|
||||
return Ok(Response::builder()
|
||||
.status(StatusCode::NOT_MODIFIED)
|
||||
.body(Body::empty())
|
||||
.unwrap());
|
||||
}
|
||||
Ok(response)
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user