mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-04-30 10:20:15 +07:00
testdata for IDEA-133935
This commit is contained in:
@@ -0,0 +1,24 @@
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TreeMap;
|
||||
|
||||
import static java.util.stream.Collectors.joining;
|
||||
import static java.util.stream.Collectors.toMap;
|
||||
|
||||
class X {
|
||||
public static Map<String, String> dumpCurrentRequestHttpHeaders(HttpServletRequest req) {
|
||||
if (req == null) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return req.getHeaderNames().stream().collect(toMap((String headerName) -> headerName,
|
||||
(String headerName) -> req.getHeaders(headerName).stream().collect(joining(", ")), (String s1, String s2) -> s1 + ", " + s2,
|
||||
TreeMap::new));
|
||||
}
|
||||
|
||||
interface HttpServletRequest {
|
||||
List<String> getHeaderNames();
|
||||
List<String> getHeaders(String header);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user