Files
ziti/controller/response/headers.go
T
Paul Lorenz 647dff62c3 Add versioning and tagging (#74)
* Add versioning and tagging

* Update for build info generation

* Return config ids as well as raw config

* Return [] not null for empty service configs list

* Try to fix body parse error issue

* Update fabric and foundation and sdk
2020-02-11 15:54:09 -05:00

30 lines
953 B
Go

/*
Copyright 2019 Netfoundry, Inc.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
https://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package response
import (
"fmt"
"github.com/netfoundry/ziti-edge/build"
version3 "github.com/netfoundry/ziti-edge/internal/version"
"net/http"
)
func AddVersionHeader(rw http.ResponseWriter) {
buildInfo := build.GetBuildInfo()
rw.Header().Set(ZitiControllerVersionHeader, fmt.Sprintf("%s/%s/%s", buildInfo.GetVersion(), buildInfo.GetRevision(), version3.GetApiVersion()))
}