changeset 150:b31af65cfe6a

- Fixed EOL to be "\r\n" instead of plain "\n".
author jcid
date Mon, 17 Mar 2008 20:04:11 +0100
parents 3f37b40ceab9
children d4369c2ce546
files src/IO/http.c src/html.cc
diffstat 2 files changed, 7 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/src/IO/http.c	Mon Mar 17 19:49:27 2008 +0100
+++ b/src/IO/http.c	Mon Mar 17 20:04:11 2008 +0100
@@ -173,7 +173,7 @@
 /*
  * Generate Content-Type header value for a POST query.
  */
-Dstr *Http_get_content_type(const DilloUrl *url)
+Dstr *Http_make_content_type(const DilloUrl *url)
 {
    Dstr *dstr;
 
@@ -183,7 +183,7 @@
       if (strlen(URL_DATA(url)) > 2) {
          /* boundary lines have "--" prepended. Skip that. */
          const char *start = URL_DATA(url) + 2;
-         char *eol = strchr(start, '\n');
+         char *eol = strchr(start, '\r');
          if (eol)
             dStr_append_l(dstr, start, eol - start);
       } else {
@@ -232,7 +232,7 @@
    cookies = a_Cookies_get_query(url);
    referer = Http_get_referer(url);
    if (URL_FLAGS(url) & URL_Post) {
-      Dstr *content_type = Http_get_content_type(url);
+      Dstr *content_type = Http_make_content_type(url);
       dStr_sprintfa(
          query,
          "POST %s HTTP/1.1\r\n"
--- a/src/html.cc	Mon Mar 17 19:49:27 2008 +0100
+++ b/src/html.cc	Mon Mar 17 20:04:11 2008 +0100
@@ -3927,10 +3927,10 @@
          }
          // todo: encode name (RFC 2231) [coming soon]
          dStr_sprintfa(url,
-                       "\n"
-                       "Content-Disposition: form-data; name=\"%s\"\n"
-                       "\n"
-                       "%s\n"
+                       "\r\n"
+                       "Content-Disposition: form-data; name=\"%s\"\r\n"
+                       "\r\n"
+                       "%s\r\n"
                        "--%s",
                        name, value, boundary);
       } else {