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

v1.3.4 replaced my custom header in open socket? #58

Closed
marain87 opened this issue Jul 24, 2019 · 5 comments
Closed

v1.3.4 replaced my custom header in open socket? #58

marain87 opened this issue Jul 24, 2019 · 5 comments

Comments

@marain87
Copy link

I am using "openSocketWithURLRequest" function with "connectionHeaders" to set my custom header.
It is normal when I am using v1.3.3 or before. But I upgrade to v1.3.4 my custom header seem to be replaced by line 137 in "connect" function ...
Does anyone have the same problem?

line 137:
// Support for Spring Boot 2.1.x
connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]

@WrathChaos
Copy link
Owner

Hi @marain87,
Looking for it :)

@WrathChaos
Copy link
Owner

@marain87 Actually you still should be able to use the function with connectionHeaders. There are two methods with "openSocketWithURLRequest".

Line 98

I just overloaded these methods. It should be working. Can you provide me with a basic sample? I can test it for you.

@marain87
Copy link
Author

marain87 commented Jul 24, 2019

HI @WrathChaos, Thanks for the reply.
Actually, I am using Line 98 function to open Socket with a custom header.
I think that the code should check null and not replace the current header value.

like following :

if (connectionHeaders == nil) {
	connectionHeaders = [StompCommands.commandHeaderAcceptVersion:"1.1,1.2"]
}

or

if (connectionHeaders == nil) {
	connectionHeaders = [:]
}
connectionHeaders![StompCommands.commandHeaderAcceptVersion] = "1.1,1.2"

@WrathChaos
Copy link
Owner

@marain87 It could be awesome if you have time to make a PR :) If you do not have time, I can add it in the future.

marain87 pushed a commit to marain87/StompClientLib that referenced this issue Jul 25, 2019
WrathChaos added a commit that referenced this issue Jul 25, 2019
#58 fix open socket with custom header issue
@WrathChaos
Copy link
Owner

Release 1.3.5 is alive now. Thank you @marain87 🔥

Just closed the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants