X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDeletePostPage.kt;h=bbbb897f0bed94f1c5bd6f8c1458f83c1d0d5360;hp=40923d3a49a6178e5073ffc832ee043f913226bc;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hpb=6105b12e4a61c270c859047866495fba2c718ee2 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/DeletePostPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/DeletePostPage.kt index 40923d3..bbbb897 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/DeletePostPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/DeletePostPage.kt @@ -1,9 +1,9 @@ package net.pterodactylus.sone.web +import net.pterodactylus.sone.utils.isPOST import net.pterodactylus.sone.web.page.FreenetRequest import net.pterodactylus.util.template.Template import net.pterodactylus.util.template.TemplateContext -import net.pterodactylus.util.web.Method.POST /** * Lets the user delete a post they made. @@ -14,7 +14,7 @@ class DeletePostPage(template: Template, webInterface: WebInterface): override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { val post = webInterface.core.getPost(request.httpRequest.getPartAsStringFailsafe("post", 36)).orNull() ?: throw RedirectException("noPermission.html") val returnPage = request.httpRequest.getPartAsStringFailsafe("returnPage", 256) - if (request.method == POST) { + if (request.isPOST) { if (!post.sone.isLocal) { throw RedirectException("noPermission.html") }