File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 44 " Joel Wurtz <jwurtz@redirection.io>"
55 ],
66 "description" : " Redirection IO Library to handle matching rule, redirect and filtering headers and body." ,
7- "version" : " 3.0.0 -dev" ,
7+ "version" : " 3.0.2 -dev" ,
88 "license" : " MIT" ,
99 "repository" : {
1010 "type" : " git" ,
11- "url" : " https://github.com/redirectionio/libredirectionio"
11+ "url" : " git+ https://github.com/redirectionio/libredirectionio.git "
1212 },
1313 "files" : [
1414 " wasm/redirectionio.d.ts" ,
Original file line number Diff line number Diff line change @@ -150,6 +150,20 @@ impl Action {
150150 Action { action }
151151 }
152152
153+ pub fn serialize ( & self ) -> String {
154+ match & self . action {
155+ None => "" . to_string ( ) ,
156+ Some ( action) => match json_encode ( action) {
157+ Err ( err) => {
158+ log:: error!( "Unable to serialize to action: {}" , err) ;
159+
160+ "" . to_string ( )
161+ }
162+ Ok ( action_serialized) => action_serialized,
163+ } ,
164+ }
165+ }
166+
153167 pub fn empty ( ) -> Action {
154168 Action { action : None }
155169 }
You can’t perform that action at this time.
0 commit comments