@@ -543,7 +543,7 @@ impl SplunkSource {
543
543
. as_ref ( )
544
544
. and_then ( |v| v. to_str ( ) . ok ( ) )
545
545
. map ( |h| h. to_ascii_lowercase ( ) . contains ( "application/json" ) )
546
- . unwrap_or ( false ) ;
546
+ . unwrap_or ( true ) ;
547
547
548
548
if !ok {
549
549
return Err ( warp:: reject:: custom ( ApiError :: UnsupportedContentType ) ) ;
@@ -2524,6 +2524,51 @@ mod tests {
2524
2524
assert ! ( ack_res. acks. get( & event_res. ack_id) . unwrap( ) ) ;
2525
2525
}
2526
2526
2527
+ #[ tokio:: test]
2528
+ async fn ack_service_accepts_parameterized_content_type ( ) {
2529
+ let ack_config = HecAcknowledgementsConfig {
2530
+ enabled : Some ( true ) ,
2531
+ ..Default :: default ( )
2532
+ } ;
2533
+ let ( source, address) = source ( Some ( ack_config) ) . await ;
2534
+ let opts = SendWithOpts {
2535
+ channel : Some ( Channel :: Header ( "guid" ) ) ,
2536
+ forwarded_for : None ,
2537
+ } ;
2538
+
2539
+ let event_res = send_with_response (
2540
+ address,
2541
+ "services/collector/event" ,
2542
+ r#"{"event":"param-test"}"# ,
2543
+ TOKEN ,
2544
+ & opts,
2545
+ )
2546
+ . await
2547
+ . json :: < HecAckEventResponse > ( )
2548
+ . await
2549
+ . unwrap ( ) ;
2550
+ let _ = collect_n ( source, 1 ) . await ;
2551
+
2552
+ let body = serde_json:: to_string ( & HecAckStatusRequest {
2553
+ acks : vec ! [ event_res. ack_id] ,
2554
+ } )
2555
+ . unwrap ( ) ;
2556
+
2557
+ let res = reqwest:: Client :: new ( )
2558
+ . post ( format ! ( "http://{}/services/collector/ack" , address) )
2559
+ . header ( "Authorization" , format ! ( "Splunk {}" , TOKEN ) )
2560
+ . header ( "x-splunk-request-channel" , "guid" )
2561
+ . header ( "Content-Type" , "application/json; some-random-text; hello" )
2562
+ . body ( body)
2563
+ . send ( )
2564
+ . await
2565
+ . unwrap ( ) ;
2566
+
2567
+ assert_eq ! ( 200 , res. status( ) . as_u16( ) ) ;
2568
+
2569
+ let _parsed: HecAckStatusResponse = res. json ( ) . await . unwrap ( ) ;
2570
+ }
2571
+
2527
2572
#[ tokio:: test]
2528
2573
async fn event_service_acknowledgements_enabled_channel_required ( ) {
2529
2574
let message = r#"{"event":"first", "color": "blue"}"# ;
0 commit comments