equal
deleted
inserted
replaced
133 if (foundV) |
133 if (foundV) |
134 return values[i]; |
134 return values[i]; |
135 else if (values[i] == v) |
135 else if (values[i] == v) |
136 foundV = true; |
136 foundV = true; |
137 return null; |
137 return null; |
|
138 } |
|
139 |
|
140 /** |
|
141 * Removes bare Negotiate and Kerberos headers when an "NTLM ..." |
|
142 * appears. All Performed on headers with key being k. |
|
143 * @return true if there is a change |
|
144 */ |
|
145 public boolean filterNTLMResponses(String k) { |
|
146 boolean found = false; |
|
147 for (int i=0; i<nkeys; i++) { |
|
148 if (k.equalsIgnoreCase(keys[i]) |
|
149 && values[i] != null && values[i].length() > 5 |
|
150 && values[i].substring(0, 5).equalsIgnoreCase("NTLM ")) { |
|
151 found = true; |
|
152 break; |
|
153 } |
|
154 } |
|
155 if (found) { |
|
156 int j = 0; |
|
157 for (int i=0; i<nkeys; i++) { |
|
158 if (k.equalsIgnoreCase(keys[i]) && ( |
|
159 "Negotiate".equalsIgnoreCase(values[i]) || |
|
160 "Kerberos".equalsIgnoreCase(values[i]))) { |
|
161 continue; |
|
162 } |
|
163 if (i != j) { |
|
164 keys[j] = keys[i]; |
|
165 values[j] = values[i]; |
|
166 } |
|
167 j++; |
|
168 } |
|
169 if (j != nkeys) { |
|
170 nkeys = j; |
|
171 return true; |
|
172 } |
|
173 } |
|
174 return false; |
138 } |
175 } |
139 |
176 |
140 class HeaderIterator implements Iterator<String> { |
177 class HeaderIterator implements Iterator<String> { |
141 int index = 0; |
178 int index = 0; |
142 int next = -1; |
179 int next = -1; |