MCPcopy Create free account
hub / github.com/FongMi/TV / buildHeader

Method buildHeader

catvod/src/main/java/com/github/catvod/utils/Auth.java:53–66  ·  view source on GitHub ↗
(String username, String realm, String nonce, String uri, String nc, String cnonce, String qop, String response, String opaque)

Source from the content-addressed store, hash-verified

51 }
52
53 private static String buildHeader(String username, String realm, String nonce, String uri, String nc, String cnonce, String qop, String response, String opaque) {
54 List<String> fields = new ArrayList<>();
55 fields.add("username=\"" + username + "\"");
56 fields.add("realm=\"" + realm + "\"");
57 fields.add("nonce=\"" + nonce + "\"");
58 fields.add("uri=\"" + uri + "\"");
59 boolean hasQop = !qop.isEmpty();
60 if (hasQop) fields.add("cnonce=\"" + cnonce + "\"");
61 if (hasQop) fields.add("nc=" + nc);
62 if (hasQop) fields.add("qop=" + qop);
63 fields.add("response=\"" + response + "\"");
64 if (opaque != null) fields.add("opaque=\"" + opaque + "\"");
65 return "Digest " + String.join(", ", fields);
66 }
67
68 private static String newCnonce() {
69 return UUID.randomUUID().toString().replace("-", "");

Callers 1

digestMethod · 0.95

Calls 2

addMethod · 0.45
isEmptyMethod · 0.45

Tested by

no test coverage detected