Loading CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Added - Explicitly set cache control header in all API responses. ## [2.5.1] - 2019-05-03 ### Changed Loading server/api.go +4 −1 Original line number Diff line number Diff line Loading @@ -200,10 +200,13 @@ func StartApiServer(logger *zap.Logger, startupLogger *zap.Logger, db *sql.DB, j handlerWithCompressResponse.ServeHTTP(w, r) }) grpcGatewayRouter.NewRoute().HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Ensure some headers have required values. // Ensure some request headers have required values. // Override any value set by the client if needed. r.Header.Set("Grpc-Timeout", gatewayContextTimeoutMs) // Add constant response headers. w.Header().Add("Cache-Control", "no-store, no-cache, must-revalidate") // Allow GRPC Gateway to handle the request. handlerWithMaxBody.ServeHTTP(w, r) }) Loading Loading
CHANGELOG.md +2 −1 Original line number Diff line number Diff line Loading @@ -4,7 +4,8 @@ All notable changes to this project are documented below. The format is based on [keep a changelog](http://keepachangelog.com) and this project uses [semantic versioning](http://semver.org). ## [Unreleased] ### Added - Explicitly set cache control header in all API responses. ## [2.5.1] - 2019-05-03 ### Changed Loading
server/api.go +4 −1 Original line number Diff line number Diff line Loading @@ -200,10 +200,13 @@ func StartApiServer(logger *zap.Logger, startupLogger *zap.Logger, db *sql.DB, j handlerWithCompressResponse.ServeHTTP(w, r) }) grpcGatewayRouter.NewRoute().HandlerFunc(func(w http.ResponseWriter, r *http.Request) { // Ensure some headers have required values. // Ensure some request headers have required values. // Override any value set by the client if needed. r.Header.Set("Grpc-Timeout", gatewayContextTimeoutMs) // Add constant response headers. w.Header().Add("Cache-Control", "no-store, no-cache, must-revalidate") // Allow GRPC Gateway to handle the request. handlerWithMaxBody.ServeHTTP(w, r) }) Loading