diff --git a/app/build.gradle b/app/build.gradle index 4380a66..87eae95 100644 --- a/app/build.gradle +++ b/app/build.gradle @@ -9,8 +9,8 @@ android { applicationId "org.woheller69.TimeLapseCam" minSdk 23 targetSdk 34 - versionCode 17 - versionName "1.7" + versionCode 18 + versionName "1.8" } diff --git a/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/HttpThread.java b/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/HttpThread.java index eaaa807..36d27e6 100644 --- a/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/HttpThread.java +++ b/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/HttpThread.java @@ -104,36 +104,39 @@ private void processRequest() throws IOException { BufferedReader reader = new BufferedReader(isr); String request = reader.readLine(); - int pos = request.indexOf(' '); - if (pos == -1) { - Log.e(TAG, "Invalid Request: «" + request + "»"); - } - String method = request.substring(0, pos); - int pos2 = request.indexOf(' ', pos + 1); - if (pos2 == -1) { - Log.e(TAG, "Invalid Request: «" + request + "»"); - } - String url = request.substring(pos + 1, pos2); - String protocol = request.substring(pos2); - - Log.d(TAG, "Request: «" + method + "» «" + url + "» «" + protocol + "»"); - - String line = reader.readLine(); - Map header = new HashMap<>(); - while (!line.isEmpty()) { - pos = line.indexOf(':'); + if (request != null) { + int pos = request.indexOf(' '); if (pos == -1) { - continue; + Log.e(TAG, "Invalid Request: «" + request + "»"); + } + String method = request.substring(0, pos); + int pos2 = request.indexOf(' ', pos + 1); + if (pos2 == -1) { + Log.e(TAG, "Invalid Request: «" + request + "»"); } + String url = request.substring(pos + 1, pos2); + String protocol = request.substring(pos2); - String key = line.substring(0, pos); - String value = line.substring(pos + 1); - header.put(key, value); + Log.d(TAG, "Request: «" + method + "» «" + url + "» «" + protocol + "»"); + + String line = reader.readLine(); + Map header = new HashMap<>(); + while (line != null && !line.isEmpty()) { + pos = line.indexOf(':'); + if (pos == -1) { + continue; + } + + String key = line.substring(0, pos); + String value = line.substring(pos + 1); + header.put(key, value); + + line = reader.readLine(); + } - line = reader.readLine(); + processRequest(method, url, protocol, header); } - processRequest(method, url, protocol, header); } /** diff --git a/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/ListFolderHtml.java b/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/ListFolderHtml.java index f3c5dc7..632c414 100644 --- a/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/ListFolderHtml.java +++ b/app/src/main/java/at/andreasrohner/spartantimelapserec/rest/ListFolderHtml.java @@ -37,7 +37,7 @@ public boolean output(String listFolder) throws IOException { @Override protected void writeHeader() throws IOException { out.sendReplyHeader(ReplyCode.FOUND, "text/html"); - out.sendLine("TimeLapsCam"); + out.sendLine("TimeLapseCam"); out.sendLine("

List folder

"); } diff --git a/fastlane/metadata/android/de-DE/changelogs/18.txt b/fastlane/metadata/android/de-DE/changelogs/18.txt new file mode 100644 index 0000000..507bade --- /dev/null +++ b/fastlane/metadata/android/de-DE/changelogs/18.txt @@ -0,0 +1 @@ +Fehlerbehebung \ No newline at end of file diff --git a/fastlane/metadata/android/en-US/changelogs/18.txt b/fastlane/metadata/android/en-US/changelogs/18.txt new file mode 100644 index 0000000..0baa73e --- /dev/null +++ b/fastlane/metadata/android/en-US/changelogs/18.txt @@ -0,0 +1 @@ +Bugfix \ No newline at end of file