-
Notifications
You must be signed in to change notification settings - Fork 42
Preserve HTTP parameter order #131
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
Preserve HTTP parameter order #131
Conversation
a2e7a6b to
abfeb65
Compare
abfeb65 to
ee8719d
Compare
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.
Pull request overview
This PR fixes an issue where HTTP query parameters were not being sent in the order they were defined when using a map variable. The fix changes HttpUtil.getTableMap() to use LinkedHashMap instead of HashMap to preserve insertion order, which is important for APIs that expect parameters in a specific sequence.
Key Changes:
- Modified
HttpUtil.getTableMap()to return aLinkedHashMapinstead ofHashMapto preserve parameter order - Added a unit test
testMapOrderPreserved()to verify that map key order is maintained when retrieving table maps
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| server/src/com/mirth/connect/util/HttpUtil.java | Changed HashMap to LinkedHashMap in getTableMap method to preserve insertion order of HTTP parameters |
| server/test/com/mirth/connect/util/HttpUtilTest.java | Added test case to verify that key order is preserved when copying maps through getTableMap |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ee8719d to
6ba242c
Compare
|
This seems to be merged in BL already: Innovar-Healthcare/BridgeLink@bca952d |
tonygermano
left a comment
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.
This PR replaces the authorship from the original PR (the bridgelink commit does not acknowledge either of the two original authors.)
The HttpUtil.getTableMap method creates and returns a copy of a Map. This commit changes the new Map instance from a HashMap to a LinkedHashMap in order to preserve the iteration order of the original Map being copied. Issue: nextgenhealthcare/connect#6276 Original-pull-request: nextgenhealthcare/connect#6296 Signed-off-by: Tony Germano <tony@germano.name>
Signed-off-by: Richard Ogin <rogin@users.noreply.github.com>
6ba242c to
1cf1c6f
Compare
Fixes issue where query parameters on an HTTP Sender Connector are not sent in order.
Apart from the included unit test, I have not verified this solution on my local machine.
Related
Original ticket - nextgenhealthcare/connect#6276
Previous PR - nextgenhealthcare/connect#6296
Summary table in #121