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: robots middleware #627

Merged
merged 1 commit into from Mar 30, 2018

Conversation

Projects
None yet
3 participants
@markelog
Copy link
Contributor

markelog commented Mar 27, 2018

Closes #610

Haven't add a way to turn it off. Should I? If so, in what format?

@CLAassistant

This comment has been minimized.

Copy link

CLAassistant commented Mar 27, 2018

CLA assistant check
All committers have signed the CLA.

@markelog markelog force-pushed the markelog:robots branch from 84bf367 to 972a319 Mar 27, 2018

// New robots middleware.
func New(c *up.Config, next http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
if os.Getenv("UP_STAGE") != "production" {

This comment has been minimized.

Copy link
@tj

tj Mar 28, 2018

Member

Works for me! Only thing I'd tweak for now is:

if os.Getenv("UP_STAGE") == "production" {
  return next
}

return otherMiddlewareHere

Or we could delegate that decision to the handler.go so it's just never added for prod

This comment has been minimized.

Copy link
@markelog

markelog Mar 28, 2018

Author Contributor

Yeah, that's much better. Incapsulated it in the middleware for now

@markelog markelog force-pushed the markelog:robots branch from 972a319 to 80c5364 Mar 28, 2018

@tj tj merged commit 527bac4 into apex:master Mar 30, 2018

3 checks passed

codeclimate All good!
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
license/cla Contributor License Agreement is signed.
Details
@tj

This comment has been minimized.

Copy link
Member

tj commented Mar 30, 2018

thanks man!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.