Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
* #21415 blocking remote calls to private subnets * #21415 Implementing ITs Co-authored-by: nollymar <nollymarlonga@Nollymars-MacBook-Pro-2.local>
- Loading branch information
Showing
7 changed files
with
149 additions
and
75 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
26 changes: 26 additions & 0 deletions
26
dotCMS/src/integration-test/java/com/dotcms/rendering/velocity/viewtools/XmlToolTest.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
package com.dotcms.rendering.velocity.viewtools; | ||
|
||
import com.dotcms.util.IntegrationTestInitService; | ||
import com.dotmarketing.exception.DotRuntimeException; | ||
import java.net.URL; | ||
import org.junit.BeforeClass; | ||
import org.junit.Test; | ||
|
||
public class XmlToolTest { | ||
@BeforeClass | ||
public static void prepare() throws Exception{ | ||
//Setting web app environment | ||
IntegrationTestInitService.getInstance().init(); | ||
} | ||
|
||
@Test | ||
public void test_xmltool_using_private_ip_should_throw_an_exception() { | ||
XmlTool xmlTool = new XmlTool(); | ||
try { | ||
xmlTool.read(new URL("https://localhost:9999/test")); | ||
} catch (Exception e){ | ||
assert (e instanceof DotRuntimeException); | ||
assert (e.getMessage().contains("XMLTool Cannot access private subnets")); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters