Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/ideal-world/bios
Browse files Browse the repository at this point in the history
  • Loading branch information
ljl committed Jan 15, 2025
2 parents a0a5881 + 075f308 commit 3261eff
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 7 deletions.
16 changes: 10 additions & 6 deletions backend/gateways/spacegate-plugins/src/plugin/anti_replay.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,19 +2,17 @@ use std::hash::DefaultHasher;
use std::sync::Arc;
use std::time::Duration;

use http::Method;
use serde::{Deserialize, Serialize};
use spacegate_shell::ext_redis::{redis::AsyncCommands, RedisClient};
use spacegate_shell::hyper::{Request, Response, StatusCode};
use spacegate_shell::kernel::extension::{IsEastWestTraffic, PeerAddr};
use spacegate_shell::kernel::helper_layers::function::Inner;
use spacegate_shell::plugin::{
plugins::east_west_traffic_white_list::{EastWestTrafficWhiteListConfig, EastWestTrafficWhiteListPlugin},
schemars, Plugin, PluginError, PluginSchemaExt,
};
use spacegate_shell::plugin::{schemars, Plugin, PluginSchemaExt};
use spacegate_shell::{BoxError, BoxResult, SgBody, SgRequest, SgRequestExt, SgResponseExt};

use tardis::serde_json;
use tardis::{basic::result::TardisResult, tokio};
use tardis::tokio;

use crate::extension::notification::AntiReplayReport;

Expand All @@ -35,7 +33,13 @@ impl Default for AntiReplayPlugin {
Self {
cache_key: "sg:plugin:anti_replay".into(),
time: 5000,
skip_methods: vec!["header".to_owned()],
skip_methods: vec![
Method::GET.to_string(),
Method::HEAD.to_string(),
Method::TRACE.to_string(),
Method::CONNECT.to_string(),
Method::OPTIONS.to_string(),
],
skip_paths: Vec::new(),
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,9 +95,9 @@ impl Default for ContentFilterConfig {
Method::GET.to_string(),
Method::HEAD.to_string(),
Method::DELETE.to_string(),
Method::HEAD.to_string(),
Method::TRACE.to_string(),
Method::CONNECT.to_string(),
Method::OPTIONS.to_string(),
],
}
}
Expand Down

0 comments on commit 3261eff

Please sign in to comment.