Skip to content

Commit

Permalink
[Zanzibar] Fix checkHeader parsing to check presence, not emptiness
Browse files Browse the repository at this point in the history
  • Loading branch information
tahmidhasan-zz committed Apr 18, 2019
1 parent 06ec349 commit 9e5fffc
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -150,7 +150,7 @@ test: generate lint
test-only:
@rm -f ./test/.cached_binary_test_info.json
@echo "Running all tests..."
@ZANZIBAR_CACHE=1 go test -race ./test/health_test.go # preload the binary cache
@ZANZIBAR_CACHE=1 go test ./test/health_test.go # preload the binary cache
@PATH=$(PATH):$(GOIMPORTS) ZANZIBAR_CACHE=1 go test -race ./codegen/... ./runtime/... | grep -v '\[no test files\]'
@PATH=$(PATH):$(GOIMPORTS) ZANZIBAR_CACHE=1 go test -race $$(go list ./examples/example-gateway/... | grep -v build) | \
grep -v '\[no test files\]'
Expand Down
4 changes: 2 additions & 2 deletions runtime/server_http_request.go
Original file line number Diff line number Diff line change
Expand Up @@ -168,8 +168,8 @@ func (req *ServerHTTPRequest) start() {
// CheckHeaders verifies that request contains required headers.
func (req *ServerHTTPRequest) CheckHeaders(headers []string) bool {
for _, headerName := range headers {
headerValue := req.httpRequest.Header.Get(headerName)
if headerValue == "" {
_, ok := req.Header.Get(headerName)
if !ok {
req.logger.Warn("Got request without mandatory header",
zap.String("headerName", headerName),
)
Expand Down

0 comments on commit 9e5fffc

Please sign in to comment.