LwHttp: fixed line break of HTTP headers (#461), fix #460

This commit is contained in:
ale5000 2017-12-26 00:27:42 +01:00 committed by Emux
parent 3cae38040c
commit 9977061680
No known key found for this signature in database
GPG Key ID: 89C6921D7AF2BDD0

View File

@ -1,5 +1,6 @@
/*
* Copyright 2013 Hannes Janetzek
* Copyright 2017 ale5000
*
* This file is part of the OpenScienceMap project (http://www.opensciencemap.org).
*
@ -97,19 +98,19 @@ public class LwHttp implements HttpEngine {
StringBuilder sb = new StringBuilder()
.append(" HTTP/1.1")
.append("\nUser-Agent: vtm/0.5.9")
.append("\nHost: ")
.append("\r\nUser-Agent: vtm/0.5.9")
.append("\r\nHost: ")
.append(mHost)
.append("\nConnection: Keep-Alive");
.append("\r\nConnection: Keep-Alive");
for (Entry<String, String> l : tileSource.getRequestHeader().entrySet()) {
String key = l.getKey();
String val = l.getValue();
//if ("Accept-Encoding".equals(key) && "gzip".equals(val))
// mUseGZIP = true;
sb.append('\n').append(key).append(": ").append(val);
sb.append("\r\n").append(key).append(": ").append(val);
}
sb.append("\n\n");
sb.append("\r\n\r\n");
REQUEST_GET_END = sb.toString().getBytes();