Skip to content

Commit a4b066e

Browse files
joeybloggsjoeybloggs
authored andcommitted
correct ParseForm + ParseMultiPartForm to append value to key instead of replace
1 parent 0718d09 commit a4b066e

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
##LARS
22
<img align="right" src="https://raw.githubusercontent.com/go-playground/lars/master/examples/README/test.gif">
3-
![Project status](https://img.shields.io/badge/version-2.4.1-green.svg)
3+
![Project status](https://img.shields.io/badge/version-2.4.2-green.svg)
44
[![Build Status](https://semaphoreci.com/api/v1/projects/4351aa2d-2f94-40be-a6ef-85c248490378/679708/badge.svg)](https://semaphoreci.com/joeybloggs/lars)
55
[![Coverage Status](https://coveralls.io/repos/github/go-playground/lars/badge.svg?branch=master)](https://coveralls.io/github/go-playground/lars?branch=master)
66
[![Go Report Card](https://goreportcard.com/badge/go-playground/lars)](https://goreportcard.com/report/go-playground/lars)

context.go

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ func (c *Ctx) ParseForm() error {
146146
}
147147

148148
for _, entry := range c.params {
149-
c.request.Form[entry.Key] = []string{entry.Value}
149+
c.request.Form.Add(entry.Key, entry.Value)
150150
}
151151

152152
c.formParsed = true
@@ -169,7 +169,7 @@ func (c *Ctx) ParseMultipartForm(maxMemory int64) error {
169169
}
170170

171171
for _, entry := range c.params {
172-
c.request.Form[entry.Key] = []string{entry.Value}
172+
c.request.Form.Add(entry.Key, entry.Value)
173173
}
174174

175175
c.multipartFormParsed = true

0 commit comments

Comments
 (0)