File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -186,5 +186,9 @@ func (h healthHandler) responseContentType(outputName string) string {
186186	if  outputName  ==  "json"  {
187187		return  "application/json" 
188188	}
189+ 	if  outputName  ==  "prometheus"  {
190+ 		return  "text/plain; version=0.0.4" 
191+ 	}
192+ 
189193	return  fmt .Sprintf ("%s%s" , mediaTypePrefix , outputName )
190194}
Original file line number Diff line number Diff line change @@ -117,6 +117,15 @@ func TestServeNegotiatingContent(t *testing.T) {
117117			expectedHTTPStatus :  http .StatusOK ,
118118			expectedContentType : "application/json" ,
119119		},
120+ 		"accept prometheus" : {
121+ 			acceptHeader : []string {
122+ 				"text/plain; version=0.0.4" ,
123+ 			},
124+ 			outputFormat :        "prometheus" ,
125+ 			specFile :            filepath .Join ("testdata" , "passing.goss.yaml" ),
126+ 			expectedHTTPStatus :  http .StatusOK ,
127+ 			expectedContentType : "text/plain; version=0.0.4" ,
128+ 		},
120129		"accept header contains vendor-specific output format different from process-level" : {
121130			acceptHeader : []string {
122131				"application/vnd.goss-rspecish" ,
    
 
   
 
     
   
   
          
     
  
    
     
 
    
      
     
 
     
    You can’t perform that action at this time.
  
 
    
  
     
    
      
        
     
 
       
      
     
   
 
    
    
  
 
  
 
     
    
0 commit comments