File tree Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Expand file tree Collapse file tree 1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -299,15 +299,23 @@ where
299299 fn call ( & self , req : ServiceRequest ) -> Self :: Future {
300300 let path = req. path ( ) ;
301301 let mode = & CONFIG . parseable . mode ;
302-
303302 // change error messages based on mode
304303 match mode {
305304 Mode :: Query => {
306- let cond = path. split ( '/' ) . any ( |x| x == "ingest" ) ;
307- if cond {
305+ // In Query mode, only allows /ingest endpoint, and /logstream endpoint with GET method
306+ let base_cond = path. split ( '/' ) . any ( |x| x == "ingest" ) ;
307+ let logstream_cond =
308+ !( path. split ( '/' ) . any ( |x| x == "logstream" ) && req. method ( ) == "GET" ) ;
309+ if base_cond {
310+ Box :: pin ( async {
311+ Err ( actix_web:: error:: ErrorUnauthorized (
312+ "Ingestion API cannot be accessed in Query Mode" ,
313+ ) )
314+ } )
315+ } else if logstream_cond {
308316 Box :: pin ( async {
309317 Err ( actix_web:: error:: ErrorUnauthorized (
310- "Ingest API cannot be accessed in Query Mode" ,
318+ "Logstream cannot be changed in Query Mode" ,
311319 ) )
312320 } )
313321 } else {
You can’t perform that action at this time.
0 commit comments