Skip to content

Commit 672c65c

Browse files
committed
fix revel#1095 and set GET, post precedance. same as php from yonder
1 parent 57885dc commit 672c65c

File tree

1 file changed

+13
-5
lines changed

1 file changed

+13
-5
lines changed

params.go

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// Copyright (c) 2012-2016 The Revel Framework Authors, All rights reserved.
1+
// Copyright (c) 2012-2017 The Revel Framework Authors, All rights reserved.
22
// Revel Framework source code and usage is governed by a MIT style
33
// license that can be found in the LICENSE file.
44

@@ -97,20 +97,28 @@ func (p *Params) calcValues() url.Values {
9797
return p.Form
9898
}
9999

100-
// Copy everything into the same map.
100+
// Copy everything into a param map
101+
// and in order of priority of lowest to most trusted
102+
// and get overwritten
101103
values := make(url.Values, numParams)
102-
for k, v := range p.Fixed {
104+
105+
// ?query vars first
106+
for k, v := range p.Query {
103107
values[k] = append(values[k], v...)
104108
}
105-
for k, v := range p.Query {
109+
// form vars second
110+
for k, v := range p.Form {
106111
values[k] = append(values[k], v...)
107112
}
113+
// :/route url vars
108114
for k, v := range p.Route {
109115
values[k] = append(values[k], v...)
110116
}
111-
for k, v := range p.Form {
117+
// fixed vars
118+
for k, v := range p.Fixed {
112119
values[k] = append(values[k], v...)
113120
}
121+
114122
return values
115123
}
116124

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy