Skip to content

Commit a9ead3b

Browse files
author
Philippon Sebastien
committed
changes parsing of the stale parameter to better support RFC and also non RFC compliant implementations
1 parent 11fa452 commit a9ead3b

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
*.iml
2+
/.idea/
3+
/target/

src/main/java/me/vzhilin/auth/parser/ChallengeResponseParser.java

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -78,14 +78,7 @@ private ChallengeResponse readDigestChallenge(ChallengeResponse challenge) throw
7878
if (readIfMatches("stale")) {
7979
readWord("=");
8080
String word = readUnquotedString();
81-
if (word.equalsIgnoreCase("true")) {
82-
challenge.setStale(true);
83-
} else
84-
if (word.equalsIgnoreCase("false")) {
85-
challenge.setStale(false);
86-
} else {
87-
throw new ParseException("expected: true | false", getPos());
88-
}
81+
challenge.setStale(word.equalsIgnoreCase("true") || word.equalsIgnoreCase("\"true\""));
8982
} else
9083
if (readIfMatches("algorithm")) {
9184
readWord("=");

0 commit comments

Comments
 (0)