mirror of
https://github.com/internetarchive/heritrix3.git
synced 2026-09-28 16:45:41 +00:00
Apply to h3
Fix for [HER-1225] HtmlFormCredential.java may create non-wellformed URLs
* HtmlFormCredential.java
only insert '&' if previous query-string was non-empty
This commit is contained in:
@@ -31,6 +31,7 @@ import org.apache.commons.httpclient.NameValuePair;
|
||||
import org.apache.commons.httpclient.URIException;
|
||||
import org.apache.commons.httpclient.methods.GetMethod;
|
||||
import org.apache.commons.httpclient.methods.PostMethod;
|
||||
import org.apache.commons.lang.StringUtils;
|
||||
import org.archive.modules.ProcessorURI;
|
||||
import org.archive.net.UURI;
|
||||
import org.archive.net.UURIFactory;
|
||||
@@ -167,8 +168,11 @@ public class HtmlFormCredential extends Credential {
|
||||
String currentQuery = hmb.getQueryString();
|
||||
hmb.setQueryString(data);
|
||||
String newQuery = hmb.getQueryString();
|
||||
hmb.setQueryString(((currentQuery != null)? currentQuery: "") +
|
||||
"&" + newQuery);
|
||||
hmb.setQueryString(
|
||||
((StringUtils.isNotEmpty(currentQuery))
|
||||
? currentQuery + "&"
|
||||
: "")
|
||||
+ newQuery);
|
||||
result = true;
|
||||
} else {
|
||||
logger.severe("Unknown method type: " + method);
|
||||
|
||||
Reference in New Issue
Block a user