Skip to content

Commit

Permalink
Merge pull request #6868 from hieupham007/timob-18887-4_0_X
Browse files Browse the repository at this point in the history
[TIMOB-18898]: Handling status line key in TiResponseCache
  • Loading branch information
pec1985 committed May 21, 2015
2 parents 243de23 + 5cb9244 commit e414b57
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -338,6 +338,11 @@ private static Map<String, List<String>> readHeaders(File hFile) throws IOExcept
if (keyval.length < 2) {
continue;
}
// restore status line key that was stored in makeLowerCaseHeaders()
if ("null".equals(keyval[0])) {
keyval[0] = null;
}

if (!headers.containsKey(keyval[0])) {
headers.put(keyval[0], new ArrayList<String>());
}
Expand Down Expand Up @@ -377,6 +382,9 @@ private Map<String, List<String>> makeLowerCaseHeaders(Map<String, List<String>>
for (String key : origHeaders.keySet()) {
if (key != null) {
headers.put(key.toLowerCase(), origHeaders.get(key));
} else {
//status line has null key
headers.put("null", origHeaders.get(key));
}
}
return headers;
Expand Down

0 comments on commit e414b57

Please sign in to comment.