From b142f8e66000bbf4ff86866fa47a6941bf06b453 Mon Sep 17 00:00:00 2001 From: Rossen Stoyanchev Date: Fri, 24 Jan 2020 15:36:46 +0000 Subject: [PATCH] Remove no-op code in URI encoding Closes gh-24413 --- .../web/util/HierarchicalUriComponents.java | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java b/spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java index 624bff55b10..cd088e039db 100644 --- a/spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java +++ b/spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java @@ -1,5 +1,5 @@ /* - * Copyright 2002-2019 the original author or authors. + * Copyright 2002-2020 the original author or authors. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -337,9 +337,6 @@ final class HierarchicalUriComponents extends UriComponents { byte[] bytes = source.getBytes(charset); boolean original = true; for (byte b : bytes) { - if (b < 0) { - b += 256; - } if (!type.isAllowed(b)) { original = false; break; @@ -351,9 +348,6 @@ final class HierarchicalUriComponents extends UriComponents { ByteArrayOutputStream bos = new ByteArrayOutputStream(bytes.length); for (byte b : bytes) { - if (b < 0) { - b += 256; - } if (type.isAllowed(b)) { bos.write(b); }