Skip to content

Commit

Permalink
Merge pull request #441 from twistedtwin/master
Browse files Browse the repository at this point in the history
[#440] Modified IpCamMJPEGStream to handle broken content length head…
  • Loading branch information
sarxos committed Feb 26, 2016
2 parents cdb4a39 + 2a2e6ae commit 8330cf0
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ public class IpCamMJPEGStream extends DataInputStream {
/**
* Name of content length header.
*/
private final String CONTENT_LENGTH = "Content-Length";
private final String CONTENT_LENGTH = "Content-Length".toLowerCase();

/**
* Maximum header length.
Expand Down Expand Up @@ -82,7 +82,7 @@ private int parseContentLength(byte[] headerBytes) throws IOException, NumberFor

String line = null;
while ((line = br.readLine()) != null) {
if (line.startsWith(CONTENT_LENGTH)) {
if (line.toLowerCase().startsWith(CONTENT_LENGTH)) {
String[] parts = line.split(":");
if (parts.length == 2) {
return Integer.parseInt(parts[1].trim());
Expand Down

0 comments on commit 8330cf0

Please sign in to comment.