mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-13 23:04:59 -05:00
Added binary data support for response class
This commit is contained in:
parent
3c6bcad7bb
commit
36aa8639fd
@ -1793,6 +1793,17 @@ public class HTTPServer {
|
|||||||
out.write(content);
|
out.write(content);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void send(int status, byte[] text) throws IOException {
|
||||||
|
//byte[] content = text.getBytes("UTF-8");
|
||||||
|
byte[] content = text;
|
||||||
|
sendHeaders(status, content.length, -1,
|
||||||
|
"W/\"" + Integer.toHexString(text.hashCode()) + "\"",
|
||||||
|
"text/html; charset=utf-8", null);
|
||||||
|
OutputStream out = getBody();
|
||||||
|
if (out != null)
|
||||||
|
out.write(content);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends an error response with the given status and detailed message.
|
* Sends an error response with the given status and detailed message.
|
||||||
* An HTML body is created containing the status and its description,
|
* An HTML body is created containing the status and its description,
|
||||||
|
Loading…
Reference in New Issue
Block a user