X-Git-Url: https://git.pterodactylus.net/?p=Sone.git;a=blobdiff_plain;f=src%2Fmain%2Fkotlin%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FDistrustPage.kt;h=f3e593eefeb6961485b3a6f0c2f204d22584e1de;hp=5ef12d1f916a0898f7af2868e188aefe5744bf4d;hb=9acbc5bdec4ccb752e0856a501568b0bb6161579;hpb=5d6bab3766964d593324f1855a0b210580473e59 diff --git a/src/main/kotlin/net/pterodactylus/sone/web/DistrustPage.kt b/src/main/kotlin/net/pterodactylus/sone/web/DistrustPage.kt index 5ef12d1..f3e593e 100644 --- a/src/main/kotlin/net/pterodactylus/sone/web/DistrustPage.kt +++ b/src/main/kotlin/net/pterodactylus/sone/web/DistrustPage.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 /** * Page that lets the user distrust another Sone. This will assign a @@ -15,7 +15,7 @@ class DistrustPage(template: Template, webInterface: WebInterface): SoneTemplatePage("distrust.html", template, "Page.Distrust.Title", webInterface, true) { override fun handleRequest(request: FreenetRequest, templateContext: TemplateContext) { - if (request.method == POST) { + if (request.isPOST) { val sone = webInterface.core.getSone(request.httpRequest.getPartAsStringFailsafe("sone", 44)).orNull() sone?.run { webInterface.core.distrustSone(getCurrentSone(request.toadletContext), this) } throw RedirectException(request.httpRequest.getPartAsStringFailsafe("returnPage", 256))