Remove no-op code in URI encoding
Closes gh-24413
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user