mirror of
https://github.com/google/nomulus
synced 2026-09-19 14:34:18 +00:00
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:
@@ -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")),
|
||||
|
||||
Reference in New Issue
Block a user