-
Notifications
You must be signed in to change notification settings - Fork 5
Expand file tree
/
Copy pathSpringXstreamUnmarshaller.java
More file actions
34 lines (23 loc) · 1010 Bytes
/
SpringXstreamUnmarshaller.java
File metadata and controls
34 lines (23 loc) · 1010 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
package com.aspectsecurity.unittestsweb.xxetestcases;
import java.io.IOException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import com.aspectsecurity.unittestsweb.ExternalTestCaseHelper;
import com.aspectsecurity.unittestsweb.XXETestCase;
@WebServlet("/springXstreamUnmarshaller")
public class SpringXstreamUnmarshaller extends XXETestCase {
protected void doTest(HttpServletRequest request, HttpServletResponse response) throws IOException {
boolean expectedSafe = true;
if (request.getParameter("unsafe") != null) {
if (request.getParameter("unsafe").equalsIgnoreCase("true"))
expectedSafe = false;
}
String path = "/springXstreamUnmarshaller";
String results = ExternalTestCaseHelper.sendExternalRequest(path, request);
if (results != null)
{
printResults(expectedSafe, results, response);
}
}
}