Do not escape WHOIS output

Both WhoisAction and WhoisHttpAction set the HTTP response content type to "text/plain". There is no need to defensively escape the content. In fact, by escaping the content, it creates more problems down the line.

When used in a website, the response should be written into a DOM node by setting the textContent of the node, which automatically escapes the content.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=196743398
This commit is contained in:
jianglai 2018-05-15 15:51:31 -07:00
parent f1219120ea
commit 7388958df7
14 changed files with 26 additions and 55 deletions

View file

@ -115,7 +115,7 @@ public class WhoisActionTest {
@Test
public void testRun_domainQuery_works() {
Registrar registrar =
persistResource(makeRegistrar("evilregistrar", "Yes Virginia <script>", ACTIVE));
persistResource(makeRegistrar("evilregistrar", "Yes Virginia", ACTIVE));
persistResource(
makeDomainResource(
"cat.lol",
@ -134,7 +134,7 @@ public class WhoisActionTest {
@Test
public void testRun_domainQuery_usesCache() {
Registrar registrar =
persistResource(makeRegistrar("evilregistrar", "Yes Virginia <script>", ACTIVE));
persistResource(makeRegistrar("evilregistrar", "Yes Virginia", ACTIVE));
persistResource(
makeDomainResource(
"cat.lol",
@ -170,7 +170,7 @@ public class WhoisActionTest {
@Test
public void testRun_idnDomain_works() throws Exception {
Registrar registrar = persistResource(makeRegistrar(
"evilregistrar", "Yes Virginia <script>", ACTIVE));
"evilregistrar", "Yes Virginia", ACTIVE));
persistResource(makeDomainResource(
"cat.みんな",
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
@ -188,7 +188,7 @@ public class WhoisActionTest {
@Test
public void testRun_punycodeDomain_works() throws Exception {
Registrar registrar = persistResource(makeRegistrar(
"evilregistrar", "Yes Virginia <script>", ACTIVE));
"evilregistrar", "Yes Virginia", ACTIVE));
persistResource(makeDomainResource(
"cat.みんな",
persistResource(makeContactResource("5372808-ERL", "(◕‿◕)", "lol@cat.みんな")),
@ -227,7 +227,7 @@ public class WhoisActionTest {
public void testRun_domainInTestTld_isConsideredNotFound() throws Exception {
persistResource(Registry.get("lol").asBuilder().setTldType(Registry.TldType.TEST).build());
Registrar registrar = persistResource(makeRegistrar(
"evilregistrar", "Yes Virginia <script>", ACTIVE));
"evilregistrar", "Yes Virginia", ACTIVE));
persistResource(makeDomainResource(
"cat.lol",
persistResource(makeContactResource("5372808-ERL", "Goblin Market", "lol@cat.lol")),