(name string)
| 1233 | } |
| 1234 | |
| 1235 | func (h *handler) PathVar(name string) string { |
| 1236 | v := mux.Vars(h.rq)[name] |
| 1237 | |
| 1238 | // Escape special chars i.e. '+' otherwise they are removed by QueryUnescape() |
| 1239 | v = strings.Replace(v, "+", "%2B", -1) |
| 1240 | |
| 1241 | // Before routing the URL we explicitly disabled expansion of %-escapes in the path |
| 1242 | // (see function FixQuotedSlashes). So we have to unescape them now. |
| 1243 | v, _ = url.QueryUnescape(v) |
| 1244 | return v |
| 1245 | } |
| 1246 | |
| 1247 | func (h *handler) SetPathVar(name string, value string) { |
| 1248 | mux.Vars(h.rq)[name] = url.QueryEscape(value) |
no outgoing calls
no test coverage detected