-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Fix Edge Case in Query Parameter Parsing #34459
Fix Edge Case in Query Parameter Parsing #34459
Conversation
API change check APIView has identified API level changes in this PR and created following API reviews. |
/azp run java - core |
Azure Pipelines successfully started running 1 pipeline(s). |
...e-storage-common/src/main/java/com/azure/storage/common/implementation/StorageImplUtils.java
Show resolved
Hide resolved
...e-storage-common/src/main/java/com/azure/storage/common/implementation/StorageImplUtils.java
Show resolved
Hide resolved
* @param queryParameters The query parameter string. | ||
* @return An {@link Iterator} over the query parameter key-value pairs. | ||
*/ | ||
public static Iterator<Map.Entry<String, String>> parseQueryParameters(String queryParameters) { |
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.
We should return Map<String, String>
instead of the iterator and the implementation could be a LinkedHashMap to preserve the order.
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 API would need to change to Map<String, QuertyParameter>
or Map<String, List<String>>
in this case, the current design is to iterate over all parsed query parameters and let the caller handle using or storing them.
Description
Fixes an edge case found in query parameter parsing for query parameters with no value, ex
key&key2=value2
.All SDK Contribution checklist:
General Guidelines and Best Practices
Testing Guidelines