summaryrefslogtreecommitdiff
path: root/src/edit/posthack.go
diff options
context:
space:
mode:
authorLuke Shumaker <lukeshu@sbcglobal.net>2016-11-15 01:59:21 -0500
committerLuke Shumaker <lukeshu@sbcglobal.net>2016-11-15 01:59:21 -0500
commitb5ce8ccc734d73dcfe9f11f7aff46b158860f276 (patch)
tree085b6900ab6431473caca82c3067e6d19bc7251d /src/edit/posthack.go
parentb2c0c37fe3c5b7bc5b762a62a3372de2b3b30538 (diff)
don't convert to CRLF when editing using the web form
Diffstat (limited to 'src/edit/posthack.go')
-rw-r--r--src/edit/posthack.go3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/edit/posthack.go b/src/edit/posthack.go
index 9e4759e..fad692b 100644
--- a/src/edit/posthack.go
+++ b/src/edit/posthack.go
@@ -44,6 +44,9 @@ func PostHack(req *http.Request) {
req.MultipartForm = nil
} else if bodies := req.PostForm["_body"]; len(bodies) > 0 {
body := bodies[0]
+ if req.PostFormValue("_body_decrlf") != "" {
+ body = strings.Replace(body, "\r\n", "\n", -1)
+ }
req.Body = ioutil.NopCloser(strings.NewReader(body))
if req.Header.Get("Content-Length") != "" {
req.Header.Set("Content-Length", strconv.Itoa(len(body)))