Skip to content

Commit 52e6f81

Browse files
ludochgae-java-bot
authored andcommitted
Fix header comparison in TaskQueueTest to be case-insensitive.
PiperOrigin-RevId: 900775764 Change-Id: If1e438dc8c9eebd446f18adb7679e9db5c008e7b
1 parent 807d883 commit 52e6f81

1 file changed

Lines changed: 8 additions & 5 deletions

File tree

api_dev/src/test/java/com/google/appengine/api/taskqueue/TaskQueueTest.java

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@
7272
import com.google.apphosting.api.ApiProxy.ApiConfig;
7373
import com.google.apphosting.api.ApiProxy.Environment;
7474
import com.google.apphosting.datastore_bytes.proto2api.DatastoreV3Pb;
75+
import com.google.common.base.Ascii;
7576
import com.google.common.collect.Lists;
7677
import com.google.common.collect.Ordering;
7778
import com.google.common.truth.Correspondence;
@@ -324,12 +325,14 @@ static class MockQueueBulkAddApiHelper extends QueueApiHelper {
324325
Ordering.natural()
325326
.onResultOf(
326327
header -> {
327-
if (DEFAULT_NAMESPACE_HEADER.equals(header.getKey())
328-
|| CURRENT_NAMESPACE_HEADER.equals(header.getKey())) {
328+
if (Ascii.equalsIgnoreCase(
329+
QueueImpl.DEFAULT_NAMESPACE_HEADER, header.getKey().toStringUtf8())
330+
|| Ascii.equalsIgnoreCase(
331+
QueueImpl.CURRENT_NAMESPACE_HEADER, header.getKey().toStringUtf8())) {
329332
return 1; // Sort namespace headers after user-specified headers.
330-
} else if ("content-type".equalsIgnoreCase(header.getKey().toStringUtf8())
331-
&& "application/x-www-form-urlencoded"
332-
.equalsIgnoreCase(header.getValue().toStringUtf8())) {
333+
} else if (Ascii.equalsIgnoreCase("content-type", header.getKey().toStringUtf8())
334+
&& Ascii.equalsIgnoreCase(
335+
"application/x-www-form-urlencoded", header.getValue().toStringUtf8())) {
333336
return 2; // Sort default content-type header last.
334337
} else {
335338
return 0; // Let everything else remain in the original order (given a stable

0 commit comments

Comments
 (0)