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

Fixed issue with HTML attachments (501 Syntax error - line too long) #114

Merged
merged 4 commits into from
Jan 31, 2021

Conversation

sanzaru
Copy link
Contributor

@sanzaru sanzaru commented Dec 7, 2020

The PR fixes an issue that occurred when trying to send long HTML attachments. The server then responded with an "501 Syntax error - line too long" error.
I also fixed some closures.

Motivation and Context

I wanted to send some HTML mails and ran into the error, also it is subject of the following issue: #106

@CLAassistant
Copy link

CLAassistant commented Dec 7, 2020

CLA assistant check
All committers have signed the CLA.

@@ -99,13 +99,13 @@ public struct SMTP {
/// - mail: `Mail` object to send.
/// - completion: Callback when sending finishes. `Error` is nil on success. (optional)
public func send(_ mail: Mail, completion: ((Error?) -> Void)? = nil) {
send([mail]) { (_, failed) in
send([mail], completion: { (_, failed) in
Copy link
Contributor

Choose a reason for hiding this comment

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

Just curious, were these syntax changes necessary?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Necessary, no - it was just XCode 12.2 (12B45b) complaining with a warning:

Backward matching of the unlabeled trailing closure is deprecated; label the argument with 'completion' to suppress this warning

Copy link
Contributor

@dannys42 dannys42 Dec 16, 2020

Choose a reason for hiding this comment

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

Oh interesting. I'll make a note to review that Issue 116, but I think your update is more readable anyway.

Copy link
Contributor

@dannys42 dannys42 left a comment

Choose a reason for hiding this comment

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

Looks good.

@dannys42
Copy link
Contributor

Would you mind rebasing to master?

@sanzaru
Copy link
Contributor Author

sanzaru commented Dec 16, 2020

Rebase done.

@sanzaru
Copy link
Contributor Author

sanzaru commented Dec 16, 2020

I fixed the tests. While running them, I found out that the line problem also occurs on data and html attachments. Should be also fixed now. All tests were successful, except TestTLSMode.testIgnoreTLS(), but that seems to be because of my server configuration, not because of the test.

@sonarcloud
Copy link

sonarcloud bot commented Dec 16, 2020

Kudos, SonarCloud Quality Gate passed!

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@lmcd
Copy link

lmcd commented Jan 28, 2021

Is this gonna be merged anytime soon?

Copy link
Member

@mbarnach mbarnach left a comment

Choose a reason for hiding this comment

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

👍

@dannys42
Copy link
Contributor

Thanks @sanzaru and @mbarnach. I think there was some travis issue previously. I'm restarting the build.

@dannys42
Copy link
Contributor

I still need to look into what it'll take to get tests working again Issue 115 But I'll push this through in the mean time.

@dannys42 dannys42 merged commit 697e73a into Kitura:master Jan 31, 2021
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.

5 participants