Browse Source

Remove no-op code in URI encoding

Closes gh-24413
pull/24429/head
Rossen Stoyanchev 6 years ago
parent
commit
b142f8e660
  1. 8
      spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java

8
spring-web/src/main/java/org/springframework/web/util/HierarchicalUriComponents.java

@ -1,5 +1,5 @@ @@ -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 { @@ -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 { @@ -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);
}

Loading…
Cancel
Save