about summary refs log tree commit diff stats
path: root/src/buffer
diff options
context:
space:
mode:
authorbptato <nincsnevem662@gmail.com>2022-12-15 19:08:58 +0100
committerbptato <nincsnevem662@gmail.com>2022-12-15 19:08:58 +0100
commita03e810d61bb165dc7f9434fc42484e61620c4c5 (patch)
tree1c95bbfcfa5706039c23e3d0b1db405bbbca9fa0 /src/buffer
parent981353831d81ae7c91e67ebce1f39b144a1f9f0f (diff)
downloadchawan-a03e810d61bb165dc7f9434fc42484e61620c4c5.tar.gz
makeCRLF: move to twtstr, write last char
Diffstat (limited to 'src/buffer')
-rw-r--r--src/buffer/buffer.nim16
1 files changed, 0 insertions, 16 deletions
diff --git a/src/buffer/buffer.nim b/src/buffer/buffer.nim
index 59655bed..cba31dbb 100644
--- a/src/buffer/buffer.nim
+++ b/src/buffer/buffer.nim
@@ -790,22 +790,6 @@ proc constructEntryList(form: HTMLFormElement, submitter: Element = nil, encodin
   return entrylist
 
 #https://html.spec.whatwg.org/multipage/form-control-infrastructure.html#multipart/form-data-encoding-algorithm
-proc makeCRLF(s: string): string =
-  result = newStringOfCap(s.len)
-  var i = 0
-  while i < s.len - 1:
-    if s[i] == '\r' and s[i + 1] != '\n':
-      result &= '\r'
-      result &= '\n'
-    elif s[i] != '\r' and s[i + 1] == '\n':
-      result &= s[i]
-      result &= '\r'
-      result &= '\n'
-      inc i
-    else:
-      result &= s[i]
-    inc i
-
 proc serializeMultipartFormData(kvs: seq[(string, string)]): MimeData =
   for it in kvs:
     let name = makeCRLF(it[0])