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

Hacktoberfest: trim fields to match mailer #221

Merged
merged 1 commit into from
Oct 19, 2020

Conversation

darinpope
Copy link
Contributor

Trim fields to match similar changes that were made to mailer.

Also matched descriptions to match mailer.

Finally, I added the same form validator to defaultSuffix that exists in mailer.

Signed-off-by: Darin Pope darin@planetpope.com

Trim fields to match similar changes that were made to mailer.

Also matched descriptions to match mailer.

Finally, I added the same form validator to defaultSuffix that exists in mailer.

Signed-off-by: Darin Pope <darin@planetpope.com>
@@ -453,6 +454,13 @@ public void setDefaultContentType(String contentType) {
}
}

public FormValidation doCheckDefaultSuffix(@QueryParameter String value) {
if (value.matches("@[A-Za-z0-9.\\-]+") || Util.fixEmptyAndTrim(value)==null)
Copy link

Choose a reason for hiding this comment

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

Are underscores not allowed in the suffix?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

according to RFC 1035 (...have as interior characters only letters, digits, and hyphen), underscores are not allowed.

This method was copied from mailer-plugin, so if it should be allowed, it probably should be done in both here and in mailer.

Copy link

Choose a reason for hiding this comment

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

Thank you for the clarification. The PR looks great to me!

address = nullify(jo.optString("address", null));
smtpHost = nullify(jo.optString("smtpHost", null));
smtpPort = nullify(jo.optString("smtpPort", null));
address = Util.nullify(jo.optString("address", null));
Copy link
Member

Choose a reason for hiding this comment

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

This constructor is no longer used, it is there only for binary compatibility.

@slide slide merged commit 6160c95 into jenkinsci:master Oct 19, 2020
@darinpope darinpope deleted the trim-fields branch October 19, 2020 20:45
@darinpope darinpope changed the title trim fields to match mailer Hacktoberfest: trim fields to match mailer Oct 24, 2020
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.

4 participants