Skip to content

Commit

Permalink
Closes #489, Closes #781, Updated docs
Browse files Browse the repository at this point in the history
Signed-off-by: Vishal Rana <[email protected]>
  • Loading branch information
vishr committed Dec 21, 2016
1 parent 562021e commit c19cb35
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 13 deletions.
2 changes: 1 addition & 1 deletion bind.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ type (
// BindUnmarshaler is the interface used to wrap the UnmarshalParam method.
BindUnmarshaler interface {
// UnmarshalParam decodes and assigns a value from an form or query param.
UnmarshalParam(src string) error
UnmarshalParam(param string) error
}
)

Expand Down
10 changes: 7 additions & 3 deletions middleware/compress.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,13 +90,17 @@ func GzipWithConfig(config GzipConfig) echo.MiddlewareFunc {
}
}

func (w *gzipResponseWriter) WriteHeader(code int) {
if code != http.StatusNoContent { // Issue #489
w.ResponseWriter.Header().Set(echo.HeaderContentEncoding, gzipScheme)
}
w.ResponseWriter.WriteHeader(code)
}

func (w *gzipResponseWriter) Write(b []byte) (int, error) {
if w.Header().Get(echo.HeaderContentType) == "" {
w.Header().Set(echo.HeaderContentType, http.DetectContentType(b))
}
if w.Header().Get(echo.HeaderContentEncoding) == "" {
w.Header().Set(echo.HeaderContentEncoding, gzipScheme)
}
return w.Writer.Write(b)
}

Expand Down
2 changes: 1 addition & 1 deletion website/layouts/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<h1>{{ .Site.Data.index.heading }}</h1>
<h2>{{ .Site.Data.index.description }}</h2>
<p>
<img style="width: 100%;" src="/images/echo_terminal.png" alt="Echo">
<img style="width: 100%;" src="/images/terminal.png" alt="Echo">
</p>
</div>

Expand Down
10 changes: 6 additions & 4 deletions website/layouts/partials/head.html
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,18 @@
<meta http-equiv="x-ua-compatible" content="ie=edge">
<meta name="description" content="{{ if ne .URL "/" }}{{ .Description }} | {{ end }}{{ .Site.Params.description }}">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="twitter:card" content="summary">
<meta name="twitter:card" content="summary_large_image">
<meta name="twitter:site" content="@echo">
<meta name="twitter:creator" content="@labstack">
<meta name="twitter:title" content="{{ if ne .URL "/" }}{{ .Title }} | {{ end }}{{ .Site.Title }}">
<meta name="twitter:description" content="{{ if ne .URL "/" }}{{ .Description }} | {{ end }}{{ .Site.Params.description }}">
<meta name="twitter:image" content="{{ .Site.BaseURL }}/images/logo.png">
<meta name="twitter:image" content="{{ .Site.BaseURL }}/images/share.png">
<meta property="og:type" content="website">
<meta property="og:site_name" content="{{ .Title }}">
<meta property="og:title" content="{{ if ne .URL "/" }}{{ .Title }} | {{ end }}{{ .Site.Title }}">
<meta property="og:site_name" content="echo">
<meta property="og:description" content="{{ if ne .URL "/" }}{{ .Description }} | {{ end }}{{ .Site.Params.description }}">
<meta property="og:url" content="{{ .Site.BaseURL }}">
<meta property="og:image" content="{{ .Site.BaseURL }}/images/logo.png">
<meta property="og:image" content="{{ .Site.BaseURL }}/images/share.png">
<title>
{{ if ne .URL "/" }}{{ .Title }} | {{ end }}{{ .Site.Title }}
</title>
Expand Down
8 changes: 4 additions & 4 deletions website/layouts/partials/notice.html
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
<!--<div class="w3-panel w3-pale-red w3-leftbar w3-border-red">
<div class="w3-panel w3-pale-green w3-leftbar w3-border-green">
<h3>
Check out our new project <a href="https://github.com/labstack/armor">Armor</a>
Check out our new project <a href="https://armor.labstack.com">Armor</a>
</h3>
<p>
Uncomplicated HTTP server, supports HTTP/2 and auto TLS
Uncomplicated, modern HTTP server, supports HTTP/2 and auto TLS
</p>
</div>-->
</div>
Binary file added website/static/images/share.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
File renamed without changes
1 change: 1 addition & 0 deletions website/static/styles/main.css
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

0 comments on commit c19cb35

Please sign in to comment.