We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
It will be great if there's an ability to add user defined header.
private String newResponseHeaders(GetRequest request) throws IOException, ProxyCacheException { String mime = source.getMime(); boolean mimeKnown = !TextUtils.isEmpty(mime); int length = cache.isCompleted() ? cache.available() : source.length(); boolean lengthKnown = length >= 0; long contentLength = request.partial ? length - request.rangeOffset : length; boolean addRange = lengthKnown && request.partial; return new StringBuilder() .append(request.partial ? "HTTP/1.1 206 PARTIAL CONTENT\n" : "HTTP/1.1 200 OK\n") .append("Accept-Ranges: bytes\n") .append(lengthKnown ? String.format("Content-Length: %d\n", contentLength) : "") .append(addRange ? String.format("Content-Range: bytes %d-%d/%d\n", request.rangeOffset, length - 1, length) : "") .append(mimeKnown ? String.format("Content-Type: %s\n", mime) : "") .append("\n") // headers end .toString(); }
Something like this:
private String newResponseHeaders(GetRequest request, HashMap<String, String> headers) { StringBuilder _headers = new StringBuilder(newResponseHeaders(request)); for (Map.Entry<String, String> entry : map.entrySet()) { _headers.append(String.format("%s: %s\n", entry.getKey(), entry.getValue())); } return _headers.toString(); }
The text was updated successfully, but these errors were encountered:
Duplicates Forward http headers from clients to server
Sorry, something went wrong.
No branches or pull requests
It will be great if there's an ability to add user defined header.
Something like this:
The text was updated successfully, but these errors were encountered: