fix: move protocol "clean" after merge of parsedOptions #1965
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
With this commit the removal of the “:”, for the protocol passed in connect options, was moved before the merge of parsedOptions.
Previously, if someone passed as a protocol “mqtts:” (Protocol returned by the URL interface) this was “cleaned” by removing the “:”.
By moving the replace after the options merge, a backward compatibility is maintained for those, like me, who find themselves having to update deps in codes where the protocol was passed in by taking the value from the URL interface.
I know that the documentation as protocol values does not accept “:”, but so far it has accepted them anyway and fixed if url is passed.
I also think that if the URL interface returns the protocol in this way, it may be convenient to pass it directly without having to modify it.