-
-
Notifications
You must be signed in to change notification settings - Fork 82
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
Refactor code and fix support spring 2.1.x #65
Conversation
Refactor code for the same logic when connect with the socket
@@ -90,16 +90,12 @@ public class StompClientLib: NSObject, SRWebSocketDelegate { | |||
} | |||
} | |||
|
|||
public func openSocketWithURLRequest(request: NSURLRequest, delegate: StompClientLibDelegate) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually without header still would be useful. It should stay with overload methods.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, you right, but I keep the same function with default connectionHeaders properties with null value with one function for the same logic, don't need override. With default connectionHeaders value in function define, you can use with without header or not, like
Without headers with defaults value is null:
socketClient.openSocketWithURLRequest(request: request, delegate: delegate)
With headers:
socketClient.openSocketWithURLRequest(request: request, delegate: delegate, connectionHeaders: headers)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Awesome answer :) Have you tested it? Does it work with your way? If it is, I will merge it and publish a new version 🎉
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yup, I have tested it with my project.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice job :) I'm gonna test it and release it soon
@baonguyena1 Thank you so much for contribution :) I merged your PR and published a new release. 🎉Release 1.3.7 🎉 |
Refactor code for the same logic when connecting with the socket
Fix connection headers for supporting spring 2.1.x