File tree Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Expand file tree Collapse file tree 4 files changed +18
-8
lines changed Original file line number Diff line number Diff line change @@ -52,3 +52,15 @@ rust_binary(
52
52
"//bazel/cargo:log" ,
53
53
],
54
54
)
55
+
56
+ rust_binary (
57
+ name = "http_config" ,
58
+ srcs = ["http_config.rs" ],
59
+ crate_type = "cdylib" ,
60
+ edition = "2018" ,
61
+ out_binary = True ,
62
+ deps = [
63
+ "//:proxy_wasm" ,
64
+ "//bazel/cargo:log" ,
65
+ ],
66
+ )
Original file line number Diff line number Diff line change @@ -30,7 +30,7 @@ impl RootContext for HttpBodyRoot {
30
30
Some ( ContextType :: HttpContext )
31
31
}
32
32
33
- fn create_http_context ( & self , _context_id : u32 ) -> Option < Box < dyn HttpContext > > {
33
+ fn create_http_context ( & self , _ : u32 ) -> Option < Box < dyn HttpContext > > {
34
34
Some ( Box :: new ( HttpBody ) )
35
35
}
36
36
}
Original file line number Diff line number Diff line change @@ -32,7 +32,7 @@ struct HttpConfigHeader {
32
32
impl Context for HttpConfigHeader { }
33
33
34
34
impl HttpContext for HttpConfigHeader {
35
- fn on_http_response_headers ( & mut self , _num_headers : usize ) -> Action {
35
+ fn on_http_response_headers ( & mut self , _ : usize ) -> Action {
36
36
self . add_http_response_header ( "custom-header" , self . header_content . as_str ( ) ) ;
37
37
Action :: Continue
38
38
}
@@ -45,14 +45,14 @@ struct HttpConfigHeaderRoot {
45
45
impl Context for HttpConfigHeaderRoot { }
46
46
47
47
impl RootContext for HttpConfigHeaderRoot {
48
- fn on_configure ( & mut self , _plugin_configuration_size : usize ) -> bool {
48
+ fn on_configure ( & mut self , _ : usize ) -> bool {
49
49
if let Some ( config_bytes) = self . get_configuration ( ) {
50
50
self . header_content = String :: from_utf8 ( config_bytes) . unwrap ( )
51
51
}
52
52
true
53
53
}
54
54
55
- fn create_http_context ( & self , _context_id : u32 ) -> Option < Box < dyn HttpContext > > {
55
+ fn create_http_context ( & self , _ : u32 ) -> Option < Box < dyn HttpContext > > {
56
56
Some ( Box :: new ( HttpConfigHeader {
57
57
header_content : self . header_content . clone ( ) ,
58
58
} ) )
Original file line number Diff line number Diff line change @@ -31,10 +31,8 @@ impl RootContext for HttpHeadersRoot {
31
31
Some ( ContextType :: HttpContext )
32
32
}
33
33
34
- fn create_http_context ( & self , _context_id : u32 ) -> Option < Box < dyn HttpContext > > {
35
- Some ( Box :: new ( HttpHeaders {
36
- context_id : _context_id,
37
- } ) )
34
+ fn create_http_context ( & self , context_id : u32 ) -> Option < Box < dyn HttpContext > > {
35
+ Some ( Box :: new ( HttpHeaders { context_id } ) )
38
36
}
39
37
}
40
38
You can’t perform that action at this time.
0 commit comments