about summary refs log tree commit diff stats
path: root/src/server
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2024-01-19 20:42:10 +0100
committerbptato <nincsnevem662@gmail.com>2024-01-19 20:49:35 +0100
commit5bca2c6e71f86558625b406c6380abba558d94fc (patch)
tree527d9cad7105ceac2acf11d0553787dd4bf879ce /src/server
parent5d3302287ff98c437c5c7592b32e1583e4b7362b (diff)
downloadchawan-5bca2c6e71f86558625b406c6380abba558d94fc.tar.gz
Fix form action when submitter has a "form" attr
* Unify form variable for all form-associated elements
* Fix broken form association logic in resetFormOwner
* Use form action for all form-associated submitters
* Remove unused getElementsByTag + de-extern some functions
Diffstat (limited to 'src/server')
-rw-r--r--src/server/buffer.nim7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/server/buffer.nim b/src/server/buffer.nim
index fbeb772c..ba94ec34 100644
--- a/src/server/buffer.nim
+++ b/src/server/buffer.nim
@@ -1246,10 +1246,11 @@ proc submitForm(form: HTMLFormElement, submitter: Element): Option[Request] =
     return
   let entrylist = form.constructEntryList(submitter).get(@[])
 
-  let action = if submitter.action() == "":
-    $form.document.url
+  let subAction = submitter.action()
+  let action = if subAction != "":
+    subAction
   else:
-    submitter.action()
+    $form.document.url
 
   let url = submitter.document.parseURL(action)
   if url.isNone: