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

Add version information to exo api #470

Merged
merged 1 commit into from
Nov 3, 2021
Merged

Add version information to exo api #470

merged 1 commit into from
Nov 3, 2021

Conversation

BenElgar
Copy link
Contributor

@BenElgar BenElgar commented Nov 3, 2021

No description provided.

@BenElgar BenElgar enabled auto-merge (squash) November 3, 2021 15:19
@BenElgar BenElgar merged commit 25eb2b1 into main Nov 3, 2021
@BenElgar BenElgar deleted the add-version-info branch November 3, 2021 15:21
@@ -55,8 +56,16 @@ func BuildRootMux(prefix string, cfg *Config) *http.ServeMux {
})
}

versionMiddleware := func(next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
w.Header().Add("Exo-Version", cfg.ExoVersion)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Kinda nitpicky, but isn't this what the Server header is for? https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Server

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess — but it's kind of nice not having to parse a version out of a server string. Nbd. Happy to change if you'd prefer.

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.

2 participants