shwstppr commented on code in PR #7445:
URL: https://github.com/apache/cloudstack/pull/7445#discussion_r1171779905
##########
services/secondary-storage/server/src/main/java/org/apache/cloudstack/storage/resource/HttpUploadServerHandler.java:
##########
@@ -130,22 +130,16 @@ public void channelRead0(ChannelHandlerContext ctx,
HttpObject msg) throws Excep
long contentLength = 0;
for (Entry<String, String> entry : request.headers()) {
- switch (entry.getKey()) {
- case HEADER_SIGNATURE:
- signature = entry.getValue();
- break;
- case HEADER_METADATA:
- metadata = entry.getValue();
- break;
- case HEADER_EXPIRES:
- expires = entry.getValue();
- break;
- case HEADER_HOST:
- hostname = entry.getValue();
- break;
- case HttpHeaders.Names.CONTENT_LENGTH:
- contentLength = Long.parseLong(entry.getValue());
- break;
+ if (HEADER_SIGNATURE.equalsIgnoreCase(entry.getKey())) {
+ signature = entry.getValue();
+ } else if
(HEADER_METADATA.equalsIgnoreCase(entry.getKey())) {
+ metadata = entry.getValue();
+ } else if
(HEADER_EXPIRES.equalsIgnoreCase(entry.getKey())) {
+ expires = entry.getValue();
+ } else if (HEADER_HOST.equalsIgnoreCase(entry.getKey())) {
+ hostname = entry.getValue();
+ } else if
(HttpHeaders.Names.CONTENT_LENGTH.equalsIgnoreCase(entry.getKey())) {
+ contentLength = Long.parseLong(entry.getValue());
Review Comment:
I prefer current changes for minimal edits
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]