Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support the more flattened HTTP response, supporting nsq v1+ #35

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

abourget
Copy link

I noticed in handler.go:

	v1 := req.Header.Get("Accept") == "application/vnd.nsq; version=1.0"

	if !v1 {
		value = struct {
			StatusCode int         `json:"status_code"`
			StatusText string      `json:"status_txt"`
			Data       interface{} `json:"data"`
		}{
			StatusCode: status,
			StatusText: text,
			Data:       value,
		}
	}

We could also do something similar here to support both versions.. a bit more refactoring would need to happen through, to bubble up the headers alongside the ret, or the ret could be a channel of more structured objects, like the LookupResult itself..

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant