1
0
Fork 0
forked from forgejo/forgejo

Fix serving of raw wiki files other than .md (#5814)

* Fix serving of raw wiki files other than .md

Closes #4690.
Closes #4395.

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Simplify code at routers/repo/wiki.go

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Add more files to user2/repo1.wiki for testing

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Update macaron to v1.3.2

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Add tests for WikiRaw

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Fix NewResponseWriter usage due to macaron update

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>

* Add raw to reserved wiki names

Signed-off-by: Gabriel Silva Simões <simoes.sgabriel@gmail.com>
This commit is contained in:
Gabriel Silva Simões 2019-02-05 20:58:55 -05:00 committed by techknowlogick
parent 4a747aef7b
commit 3b7f41f9f7
17 changed files with 77 additions and 31 deletions

View file

@ -262,7 +262,7 @@ func (ctx *Context) Params(name string) string {
// SetParams sets value of param with given name.
func (ctx *Context) SetParams(name, val string) {
if !strings.HasPrefix(name, ":") {
if name != "*" && !strings.HasPrefix(name, ":") {
name = ":" + name
}
ctx.params[name] = val
@ -270,7 +270,7 @@ func (ctx *Context) SetParams(name, val string) {
// ReplaceAllParams replace all current params with given params
func (ctx *Context) ReplaceAllParams(params Params) {
ctx.params = params;
ctx.params = params
}
// ParamsEscape returns escapred params result.