Browse Source

#2593 allow render raw content

Use URL query parameter render=1 to render content in raw mode.
pull/3390/head
Unknwon 9 years ago
parent
commit
ab9c5fb5e7
  1. 2
      .gopmfile
  2. 2
      README.md
  3. 2
      cmd/web.go
  4. 2
      glide.lock
  5. 2
      gogs.go
  6. 2
      routers/repo/download.go
  7. 2
      templates/.VERSION

2
.gopmfile

@ -50,7 +50,7 @@ gopkg.in/bufio.v1 = commit:567b2bf
gopkg.in/gomail.v2 = commit:81ebce5 gopkg.in/gomail.v2 = commit:81ebce5
gopkg.in/ini.v1 = commit:cf53f92 gopkg.in/ini.v1 = commit:cf53f92
gopkg.in/ldap.v2 = commit:537128f gopkg.in/ldap.v2 = commit:537128f
gopkg.in/macaron.v1 = commit:2133042 gopkg.in/macaron.v1 = commit:7564489
gopkg.in/redis.v2 = commit:e617904 gopkg.in/redis.v2 = commit:e617904
[res] [res]

2
README.md

@ -3,7 +3,7 @@ Gogs - Go Git Service [![Build Status](https://travis-ci.org/gogits/gogs.svg?bra
![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true) ![](https://github.com/gogits/gogs/blob/master/public/img/gogs-large-resize.png?raw=true)
##### Current tip version: 0.9.63 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions) ##### Current tip version: 0.9.64 (see [Releases](https://github.com/gogits/gogs/releases) for binary versions)
| Web | UI | Preview | | Web | UI | Preview |
|:-------------:|:-------:|:-------:| |:-------------:|:-------:|:-------:|

2
cmd/web.go

@ -86,7 +86,7 @@ func checkVersion() {
{"github.com/go-macaron/session", session.Version, "0.1.6"}, {"github.com/go-macaron/session", session.Version, "0.1.6"},
{"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"}, {"github.com/go-macaron/toolbox", toolbox.Version, "0.1.0"},
{"gopkg.in/ini.v1", ini.Version, "1.8.4"}, {"gopkg.in/ini.v1", ini.Version, "1.8.4"},
{"gopkg.in/macaron.v1", macaron.Version, "1.1.4"}, {"gopkg.in/macaron.v1", macaron.Version, "1.1.7"},
{"github.com/gogits/git-module", git.Version, "0.3.3"}, {"github.com/gogits/git-module", git.Version, "0.3.3"},
{"github.com/gogits/go-gogs-client", gogs.Version, "0.10.1"}, {"github.com/gogits/go-gogs-client", gogs.Version, "0.10.1"},
} }

2
glide.lock generated

@ -142,7 +142,7 @@ imports:
- name: gopkg.in/ldap.v2 - name: gopkg.in/ldap.v2
version: 537128fee7cca108d8ce74e4309fdfcdd9c7f496 version: 537128fee7cca108d8ce74e4309fdfcdd9c7f496
- name: gopkg.in/macaron.v1 - name: gopkg.in/macaron.v1
version: 2133042f8d1022b8253e4e23f7940467941409ce version: 7564489a79f3f96b7ac8034652b35eeebb468eb4
- name: gopkg.in/redis.v2 - name: gopkg.in/redis.v2
version: e6179049628164864e6e84e973cfb56335748dea version: e6179049628164864e6e84e973cfb56335748dea
devImports: [] devImports: []

2
gogs.go

@ -17,7 +17,7 @@ import (
"github.com/gogits/gogs/modules/setting" "github.com/gogits/gogs/modules/setting"
) )
const APP_VER = "0.9.63.0805" const APP_VER = "0.9.64.0805"
func init() { func init() {
runtime.GOMAXPROCS(runtime.NumCPU()) runtime.GOMAXPROCS(runtime.NumCPU())

2
routers/repo/download.go

@ -28,7 +28,7 @@ func ServeData(ctx *context.Context, name string, reader io.Reader) error {
ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreeName)+"\"") ctx.Resp.Header().Set("Content-Disposition", "attachment; filename=\""+path.Base(ctx.Repo.TreeName)+"\"")
ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary") ctx.Resp.Header().Set("Content-Transfer-Encoding", "binary")
} }
} else { } else if !ctx.QueryBool("render") {
ctx.Resp.Header().Set("Content-Type", "text/plain; charset=utf-8") ctx.Resp.Header().Set("Content-Type", "text/plain; charset=utf-8")
} }
ctx.Resp.Write(buf) ctx.Resp.Write(buf)

2
templates/.VERSION

@ -1 +1 @@
0.9.63.0805 0.9.64.0805
Loading…
Cancel
Save