mirror of
https://github.com/apache/cordova-android.git
synced 2025-02-26 12:03:28 +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();
|
request = xhrReader.readLine();
|
||||||
String response = "";
|
String response = "";
|
||||||
//System.out.println("CallbackServerRequest="+request);
|
//System.out.println("CallbackServerRequest="+request);
|
||||||
if (request != null) {
|
if (this.active && (request != null)) {
|
||||||
if (request.contains("GET")) {
|
if (request.contains("GET")) {
|
||||||
|
|
||||||
|
// Get requested file
|
||||||
|
String[] requestParts = request.split(" ");
|
||||||
|
|
||||||
// Must have security token
|
// 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");
|
//System.out.println("CallbackServer -- Processing GET request");
|
||||||
|
|
||||||
// Wait until there is some data to send, or send empty data every 10 sec
|
// Wait until there is some data to send, or send empty data every 10 sec
|
||||||
|
Loading…
Reference in New Issue
Block a user