mirror of
https://github.com/librecaptcha/lc-core.git
synced 2025-01-27 13:03:12 -05:00
Remove POST support for media endpoint
Signed-off-by: Rahul Rudragoudar <rr83019@gmail.com>
This commit is contained in:
parent
b16c2698d2
commit
c10a66a23b
@ -26,21 +26,13 @@ class Server(port: Int, captcha: Captcha, dbConn: DBConn){
|
|||||||
},"POST")
|
},"POST")
|
||||||
|
|
||||||
host.addContext("/v1/media",(req, resp) => {
|
host.addContext("/v1/media",(req, resp) => {
|
||||||
val id = if ("GET" == req.getMethod()){
|
val params = req.getParams()
|
||||||
val params = req.getParams()
|
val id = Id(params.get("id"))
|
||||||
val gid = Id(params.get("id"))
|
|
||||||
gid
|
|
||||||
} else {
|
|
||||||
val body = req.getJson()
|
|
||||||
val json = parse(body)
|
|
||||||
val gid = json.extract[Id]
|
|
||||||
gid
|
|
||||||
}
|
|
||||||
val image = captcha.getCaptcha(id)
|
val image = captcha.getCaptcha(id)
|
||||||
resp.getHeaders().add("Content-Type","image/png")
|
resp.getHeaders().add("Content-Type","image/png")
|
||||||
resp.send(200, image)
|
resp.send(200, image)
|
||||||
0
|
0
|
||||||
},"POST", "GET")
|
},"GET")
|
||||||
|
|
||||||
host.addContext("/v1/answer",(req, resp) => {
|
host.addContext("/v1/answer",(req, resp) => {
|
||||||
val body = req.getJson()
|
val body = req.getJson()
|
||||||
|
Loading…
x
Reference in New Issue
Block a user