Maybe a mistake?

Co-authored-by: sigonasr2 <sigonasr2@gmail.com>
main
sigonasr2 3 years ago
parent 986214bf66
commit f10e80c7f7
  1. 7
      sigServer.java

@ -84,9 +84,10 @@ public class sigServer {
if (boundary.length()>0) { if (boundary.length()>0) {
if (line.equals(boundary)) { if (line.equals(boundary)) {
truncateUntilBoundary=true; truncateUntilBoundary=true;
System.out.println("Boundary found.");
} }
} }
} else } else {
if (line.contains("Content-Disposition: ")||line.contains("Content-Type: ")) { if (line.contains("Content-Disposition: ")||line.contains("Content-Type: ")) {
if (line.contains("filename=")) { if (line.contains("filename=")) {
filename=line.substring(line.indexOf("filename=")+"filename=".length()+1); filename=line.substring(line.indexOf("filename=")+"filename=".length()+1);
@ -151,14 +152,14 @@ public class sigServer {
filename=null; filename=null;
} }
} }
}
if (line.contains("Content-Length: ")) { if (line.contains("Content-Length: ")) {
expectedDataLength=Integer.parseInt(line.substring("Content-Length: ".length())); expectedDataLength=Integer.parseInt(line.substring("Content-Length: ".length()));
System.out.println("Expecting a length of "+expectedDataLength); System.out.println("Expecting a length of "+expectedDataLength);
} }
if (line.contains("Content-Type:")) { if (line.contains("Content-Type:")) {
if (line.contains("Content-Type: multipart/form-data; boundary=")) { if (line.contains("Content-Type: multipart/form-data; boundary=")) {
boundary=line.substring("Content-Type: multipart/form-data; boundary=".length()); boundary="--"+line.substring("Content-Type: multipart/form-data; boundary=".length());
System.out.println("Boundary set to "+boundary);
} else } else
if (line.contains("application/json")){ if (line.contains("application/json")){
isApplication=true; isApplication=true;

Loading…
Cancel
Save