Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion HTTP.java
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ of this software and associated documentation files (the "Software"), to deal
*/

import java.util.Iterator;
import java.util.Locale;

/**
* Convert an HTTP header to a JSONObject and back.
Expand Down Expand Up @@ -74,7 +75,7 @@ public static JSONObject toJSONObject(String string) throws JSONException {
String token;

token = x.nextToken();
if (token.toUpperCase().startsWith("HTTP")) {
if (token.toUpperCase(Locale.ROOT).startsWith("HTTP")) {

// Response

Expand Down
4 changes: 2 additions & 2 deletions JSONObject.java
Original file line number Diff line number Diff line change
Expand Up @@ -1157,9 +1157,9 @@ private void populateMap(Object bean) {
&& Character.isUpperCase(key.charAt(0))
&& method.getParameterTypes().length == 0) {
if (key.length() == 1) {
key = key.toLowerCase();
key = key.toLowerCase(Locale.ROOT);
} else if (!Character.isUpperCase(key.charAt(1))) {
key = key.substring(0, 1).toLowerCase()
key = key.substring(0, 1).toLowerCase(Locale.ROOT)
+ key.substring(1);
}

Expand Down