mirror of
https://github.com/google/nomulus.git
synced 2025-06-27 23:03:34 +02:00
Fix double-URL-encoding bug in LoadTestAction
This was inadvertently introduced in [] - the original code manually URL-encoded the XML, but the TaskOptions.param() method does that for you, so now we're double-URL-encoding the XML and as a result the actual /_dr/epptool invocation is failing with a syntax error (which was somewhat hard to diagnose, since it logs nothing and returns HTTP 200 in that case - to be fixed separately). ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=137321114
This commit is contained in:
parent
748dd34385
commit
1ac0832c79
1 changed files with 1 additions and 12 deletions
|
@ -22,7 +22,6 @@ import static com.google.common.collect.Lists.transform;
|
||||||
import static google.registry.security.XsrfTokenManager.X_CSRF_TOKEN;
|
import static google.registry.security.XsrfTokenManager.X_CSRF_TOKEN;
|
||||||
import static google.registry.util.FormattingLogger.getLoggerForCallerClass;
|
import static google.registry.util.FormattingLogger.getLoggerForCallerClass;
|
||||||
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
import static google.registry.util.ResourceUtils.readResourceUtf8;
|
||||||
import static java.nio.charset.StandardCharsets.UTF_8;
|
|
||||||
import static java.util.Arrays.asList;
|
import static java.util.Arrays.asList;
|
||||||
import static org.joda.time.DateTimeZone.UTC;
|
import static org.joda.time.DateTimeZone.UTC;
|
||||||
|
|
||||||
|
@ -37,8 +36,6 @@ import google.registry.request.Parameter;
|
||||||
import google.registry.security.XsrfTokenManager;
|
import google.registry.security.XsrfTokenManager;
|
||||||
import google.registry.util.FormattingLogger;
|
import google.registry.util.FormattingLogger;
|
||||||
import google.registry.util.TaskEnqueuer;
|
import google.registry.util.TaskEnqueuer;
|
||||||
import java.io.UnsupportedEncodingException;
|
|
||||||
import java.net.URLEncoder;
|
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.Iterator;
|
import java.util.Iterator;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -339,19 +336,11 @@ public class LoadTestAction implements Runnable {
|
||||||
.param("clientId", clientId)
|
.param("clientId", clientId)
|
||||||
.param("superuser", Boolean.FALSE.toString())
|
.param("superuser", Boolean.FALSE.toString())
|
||||||
.param("dryRun", Boolean.FALSE.toString())
|
.param("dryRun", Boolean.FALSE.toString())
|
||||||
.param("xml", urlEncode(xmls.get(i))));
|
.param("xml", xmls.get(i)));
|
||||||
}
|
}
|
||||||
return tasks.build();
|
return tasks.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private String urlEncode(String xml) {
|
|
||||||
try {
|
|
||||||
return URLEncoder.encode(xml, UTF_8.toString());
|
|
||||||
} catch (UnsupportedEncodingException e) {
|
|
||||||
throw new RuntimeException(e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private void enqueue(List<TaskOptions> tasks) {
|
private void enqueue(List<TaskOptions> tasks) {
|
||||||
List<List<TaskOptions>> chunks = partition(tasks, maxTasksPerAdd());
|
List<List<TaskOptions>> chunks = partition(tasks, maxTasksPerAdd());
|
||||||
// Farm out tasks to multiple queues to work around queue qps quotas.
|
// Farm out tasks to multiple queues to work around queue qps quotas.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue