File tree Expand file tree Collapse file tree 3 files changed +148
-9
lines changed Expand file tree Collapse file tree 3 files changed +148
-9
lines changed Original file line number Diff line number Diff line change @@ -31,6 +31,10 @@ and this project adheres to
3131
3232-  [ #5222  ] ( https://github.com/firecracker-microvm/firecracker/pull/5222 ) : Fixed
3333  network and rng devices locking up on hosts with non 4K pages.
34+ -  [ #5226  ] ( https://github.com/firecracker-microvm/firecracker/pull/5226 ) : Fixed
35+   MMDS to set ` Content-Type `  header correctly (i.e. ` Content-Type: text/plain ` 
36+   for IMDS-formatted or error responses and ` Content-Type: application/json `  for
37+   JSON-formatted responses).
3438
3539## [ 1.12.0]  
3640
Original file line number Diff line number Diff line change @@ -352,7 +352,8 @@ mod tests {
352352            ], 
353353            "member": false, 
354354            "shares_percentage": 12.12, 
355-             "balance": -24 
355+             "balance": -24, 
356+             "json_string": "{\n  \"hello\": \"world\"\n}" 
356357        }"# ; 
357358        let  data_store:  Value  = serde_json:: from_str ( data) . unwrap ( ) ; 
358359        mmds. put_data ( data_store) . unwrap ( ) ; 
@@ -492,6 +493,18 @@ mod tests {
492493                . to_string( ) , 
493494            MmdsDatastoreError :: UnsupportedValueType . to_string( ) 
494495        ) ; 
496+ 
497+         // Retrieve a string including escapes. 
498+         assert_eq ! ( 
499+             mmds. get_value( "/json_string" . to_string( ) ,  OutputFormat :: Json ) 
500+                 . unwrap( ) , 
501+             r#""{\n  \"hello\": \"world\"\n}""# 
502+         ) ; 
503+         assert_eq ! ( 
504+             mmds. get_value( "/json_string" . to_string( ) ,  OutputFormat :: Imds ) 
505+                 . unwrap( ) , 
506+             "{\n   \" hello\" : \" world\" \n }" 
507+         ) 
495508    } 
496509
497510    #[ test]  
 
 
   
 
     
   
   
          
    
    
     
    
      
     
     
    You can’t perform that action at this time.
  
 
    
  
    
      
        
     
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments