mirror of
https://github.com/apache/cordova-android.git
synced 2025-01-19 07:02:51 +08:00
Ticket 63: Android CallbackServer crashes on external attacks.
This commit is contained in:
parent
f16d9b01b7
commit
9051b157f8
@ -188,11 +188,14 @@ public class CallbackServer implements Runnable {
|
||||
request = xhrReader.readLine();
|
||||
String response = "";
|
||||
//System.out.println("CallbackServerRequest="+request);
|
||||
if (request != null) {
|
||||
if (this.active && (request != null)) {
|
||||
if (request.contains("GET")) {
|
||||
|
||||
// Get requested file
|
||||
String[] requestParts = request.split(" ");
|
||||
|
||||
// Must have security token
|
||||
if (request.substring(5,41).equals(this.token)) {
|
||||
if ((requestParts.length == 3) && (requestParts[1].equals(this.token))) {
|
||||
//System.out.println("CallbackServer -- Processing GET request");
|
||||
|
||||
// Wait until there is some data to send, or send empty data every 10 sec
|
||||
@ -236,7 +239,7 @@ public class CallbackServer implements Runnable {
|
||||
//System.out.println("CallbackServer: closing output");
|
||||
output.writeBytes(response);
|
||||
output.flush();
|
||||
}
|
||||
}
|
||||
output.close();
|
||||
xhrReader.close();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user