File tree 1 file changed +12
-4
lines changed
1 file changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -299,15 +299,23 @@ where
299
299
fn call ( & self , req : ServiceRequest ) -> Self :: Future {
300
300
let path = req. path ( ) ;
301
301
let mode = & CONFIG . parseable . mode ;
302
-
303
302
// change error messages based on mode
304
303
match mode {
305
304
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 {
308
316
Box :: pin ( async {
309
317
Err ( actix_web:: error:: ErrorUnauthorized (
310
- "Ingest API cannot be accessed in Query Mode" ,
318
+ "Logstream cannot be changed in Query Mode" ,
311
319
) )
312
320
} )
313
321
} else {
You can’t perform that action at this time.
0 commit comments