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

Fix healthcheck path #2295

Merged
merged 4 commits into from
Oct 23, 2017
Merged

Conversation

emilevauge
Copy link
Member

@emilevauge emilevauge commented Oct 20, 2017

Description

This PR fixes healthcheck path.

Fixes #2273

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

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

@emilevauge Well done 😉

Just a question.

}
if gc.Web.Path[len(gc.Web.Path)-1:] != "/" {
gc.Web.Path += "/"
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Can not use a single if block ?

               if gc.Web.Path == "" || gc.Web.Path[len(gc.Web.Path)-1:] != "/"  {
 			gc.Web.Path += "/"
 		}

Copy link
Member Author

Choose a reason for hiding this comment

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

Fixed :)

Copy link
Contributor

@nmengin nmengin left a comment

Choose a reason for hiding this comment

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

LGTM 👏

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

few comments

gc.LogLevel = "DEBUG"
}
if gc.Web != nil {
if gc.Web.Path == "" || gc.Web.Path[len(gc.Web.Path)-1:] != "/" {
Copy link
Contributor

Choose a reason for hiding this comment

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

gc.Web.Path[len(gc.Web.Path)-1:] != "/" can be replace by a !strings.HasSuffix(gc.Web.Path, "/")

Copy link
Contributor

Choose a reason for hiding this comment

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

the 2 if can be merged:

if gc.Web != nil && (gc.Web.Path == "" || !strings.HasSuffix(gc.Web.Path, "/")) {
	gc.Web.Path += "/"
}

Copy link
Member

@juliens juliens left a comment

Choose a reason for hiding this comment

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

LGTM

Copy link
Contributor

@ldez ldez left a comment

Choose a reason for hiding this comment

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

LGTM

@traefiker traefiker merged commit de821fc into traefik:v1.4 Oct 23, 2017
@nmengin nmengin changed the title fix healthcheck path Fix healthcheck path Oct 24, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants