mirror of
				https://github.com/containers/podman.git
				synced 2025-10-31 18:08:51 +08:00 
			
		
		
		
	 98c1b23624
			
		
	
	98c1b23624
	
	
	
		
			
			* Update tests to reflect system endpoints * First implementation of compat /system/df, only fields that are populated by libpod are set Signed-off-by: Jhon Honce <jhonce@redhat.com>
		
			
				
	
	
		
			30 lines
		
	
	
		
			846 B
		
	
	
	
		
			Go
		
	
	
	
	
	
			
		
		
	
	
			30 lines
		
	
	
		
			846 B
		
	
	
	
		
			Go
		
	
	
	
	
	
| package compat
 | |
| 
 | |
| import (
 | |
| 	"fmt"
 | |
| 	"net/http"
 | |
| 
 | |
| 	"github.com/containers/buildah"
 | |
| )
 | |
| 
 | |
| // Ping returns headers to client about the service
 | |
| //
 | |
| // This handler must always be the same for the compatibility and libpod URL trees!
 | |
| // Clients will use the Header availability to test which backend engine is in use.
 | |
| // Note: Additionally handler supports GET and HEAD methods
 | |
| func Ping(w http.ResponseWriter, r *http.Request) {
 | |
| 	// Note API-Version and Libpod-API-Version are set in handler_api.go
 | |
| 	w.Header().Set("BuildKit-Version", "")
 | |
| 	w.Header().Set("Builder-Version", "")
 | |
| 	w.Header().Set("Docker-Experimental", "true")
 | |
| 	w.Header().Set("Cache-Control", "no-cache")
 | |
| 	w.Header().Set("Pragma", "no-cache")
 | |
| 
 | |
| 	w.Header().Set("Libpod-Buildah-Version", buildah.Version)
 | |
| 	w.WriteHeader(http.StatusOK)
 | |
| 
 | |
| 	if r.Method == http.MethodGet {
 | |
| 		fmt.Fprint(w, "OK")
 | |
| 	}
 | |
| }
 |