Skip to content
This repository has been archived by the owner on Feb 24, 2024. It is now read-only.

v0.16.15 #2043

Merged
merged 33 commits into from
Sep 5, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
834c095
adding direct version on the docker build
paganotoni Apr 21, 2020
dea73d0
merging
paganotoni Apr 21, 2020
ef66b75
fixing plugin installation
paganotoni Apr 21, 2020
f54ca9e
Merge branch 'master' of https://github.com/gobuffalo/buffalo
paganotoni May 8, 2020
1c74ae6
Merge branch 'master' of https://github.com/gobuffalo/buffalo
paganotoni May 25, 2020
7827df3
Fix npm's package.json permissions (#2005)
disconnect3d Jun 9, 2020
9da3740
Bump spf13/viper to v1.7.0 (#1999)
aeneasr Jun 9, 2020
be95bfe
Merge branch 'master' into development
paganotoni Jun 9, 2020
4aa9475
bunping version
paganotoni Jun 9, 2020
9e9d5bf
changing version on dockerfile
paganotoni Jun 9, 2020
e9d8c0a
patch to fix the keywords check on new app
paganotoni Jul 15, 2020
b6ec6e4
Merge branch 'master' of https://github.com/gobuffalo/buffalo into de…
paganotoni Jul 15, 2020
7fc13fb
removing unneeded append
paganotoni Jul 15, 2020
d86adbc
Task fixing html binder (#2016)
paganotoni Jul 16, 2020
e5ff685
adding new version number
paganotoni Jul 16, 2020
af37208
Merge branch 'master' of https://github.com/gobuffalo/buffalo
paganotoni Jul 16, 2020
947543c
Merge branch 'master' into development
paganotoni Jul 16, 2020
4362a83
pulling the buffalo binary from gobinaries.com
paganotoni Jul 18, 2020
2150f08
Merge branch 'master' of https://github.com/gobuffalo/buffalo into de…
paganotoni Jul 18, 2020
7e6b165
Merge branch 'master' of https://github.com/gobuffalo/buffalo
paganotoni Jul 29, 2020
f52bbc2
Merge branch 'master' into development
paganotoni Jul 29, 2020
b0f043a
Task updating formam (#2025)
paganotoni Jul 29, 2020
b30b49a
Merge branch 'development' of https://github.com/gobuffalo/buffalo in…
paganotoni Jul 29, 2020
2a6f20b
Fixes #1987 and #2023 (#2026)
paganotoni Aug 2, 2020
5eeaa2a
Merge branch 'development' of https://github.com/gobuffalo/buffalo in…
paganotoni Aug 2, 2020
4643bad
changing version number
paganotoni Aug 2, 2020
39711ae
moving to latest 2 go versions (#2038)
paganotoni Sep 4, 2020
e44a95d
Task binding cleanup (#2039)
paganotoni Sep 4, 2020
859e828
Task update formam (#2041)
paganotoni Sep 5, 2020
ec9ca99
updating flect versionm (#2042)
paganotoni Sep 5, 2020
0c5aed0
updating version
paganotoni Sep 5, 2020
a7388dd
Merge branch 'master' of https://github.com/gobuffalo/buffalo
paganotoni Sep 5, 2020
85b1a29
Merge branch 'master' into development
paganotoni Sep 5, 2020
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
go-version: [1.13.x, 1.14.x]
go-version: [1.14.x, 1.15.x]
os: [macos-latest, windows-latest, ubuntu-latest]
env:
GO111MODULE: on
Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.build
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ RUN npm install -g --no-progress yarn \
# Install golangci
RUN curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh -s -- -b $(go env GOPATH)/bin v1.24.0
# Installing buffalo binary
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].14 | sh
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].15 | sh
RUN go get github.com/gobuffalo/buffalo-pop/v2
RUN buffalo version

Expand Down
2 changes: 1 addition & 1 deletion Dockerfile.slim.build
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ RUN npm i -g --no-progress yarn \
&& yarn config set yarn-offline-mirror-pruning true

# Pulling docker binary from releases
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].14 | sh
RUN curl -sf https://gobinaries.com/gobuffalo/buffalo/[email protected].15 | sh
RUN go get github.com/gobuffalo/buffalo-pop/v2
RUN buffalo version

Expand Down
25 changes: 20 additions & 5 deletions binding/binding.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@ package binding

import (
"net/http"
"time"

"github.com/gobuffalo/buffalo/binding/decoders"
"github.com/gobuffalo/nulls"
"github.com/monoculum/formam"
)

Expand All @@ -14,16 +16,16 @@ var (
// information on how this impacts file uploads.
MaxFileMemory int64 = 5 * 1024 * 1024

formDecoder = formam.NewDecoder(&formam.DecoderOptions{
TagName: "form",
IgnoreUnknownKeys: true,
})
// formDecoder (formam) that will be used across ContentTypeBinders
formDecoder = buildFormDecoder()

// BaseRequestBinder is an instance of the requestBinder, it comes with preconfigured
// content type binders for HTML, JSON, XML and Files, as well as custom types decoders
// for time.Time and nulls.Time
BaseRequestBinder = NewRequestBinder(
NewHTMLContentTypeBinder(formDecoder),
HTMLContentTypeBinder{
decoder: formDecoder,
},
JSONContentTypeBinder{},
XMLRequestTypeBinder{},
FileRequestTypeBinder{
Expand All @@ -32,6 +34,19 @@ var (
)
)

// buildFormDecoder that will be used in the package. This method adds some custom decoders for time.Time and nulls.Time.
func buildFormDecoder() *formam.Decoder {
decoder := formam.NewDecoder(&formam.DecoderOptions{
TagName: "form",
IgnoreUnknownKeys: true,
})

decoder.RegisterCustomType(decoders.TimeDecoderFn(), []interface{}{time.Time{}}, nil)
decoder.RegisterCustomType(decoders.NullTimeDecoderFn(), []interface{}{nulls.Time{}}, nil)

return decoder
}

// RegisterTimeFormats allows to add custom time layouts that
// the binder will be able to use for decoding.
func RegisterTimeFormats(layouts ...string) {
Expand Down
14 changes: 0 additions & 14 deletions binding/html_content_type_binder.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,7 @@ package binding

import (
"net/http"
"time"

"github.com/gobuffalo/buffalo/binding/decoders"
"github.com/gobuffalo/nulls"
"github.com/monoculum/formam"
)

Expand All @@ -14,17 +11,6 @@ type HTMLContentTypeBinder struct {
decoder *formam.Decoder
}

// NewHTMLContentTypeBinder returns an instance of HTMLContentTypeBinder with
// custom type decoders registered for Time and nulls.Time
func NewHTMLContentTypeBinder(decoder *formam.Decoder) HTMLContentTypeBinder {
decoder.RegisterCustomType(decoders.TimeDecoderFn(), []interface{}{time.Time{}}, nil)
decoder.RegisterCustomType(decoders.NullTimeDecoderFn(), []interface{}{nulls.Time{}}, nil)

return HTMLContentTypeBinder{
decoder: decoder,
}
}

// ContentTypes that will be used to identify HTML requests
func (ht HTMLContentTypeBinder) ContentTypes() []string {
return []string{
Expand Down
4 changes: 2 additions & 2 deletions go.mod
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ require (
github.com/gobuffalo/clara/v2 v2.0.2
github.com/gobuffalo/envy v1.9.0
github.com/gobuffalo/events v1.4.1
github.com/gobuffalo/flect v0.2.1
github.com/gobuffalo/flect v0.2.2
github.com/gobuffalo/genny/v2 v2.0.6
github.com/gobuffalo/github_flavored_markdown v1.1.0
github.com/gobuffalo/helpers v0.6.1
Expand All @@ -34,7 +34,7 @@ require (
github.com/markbates/refresh v1.11.1
github.com/markbates/safe v1.0.1
github.com/markbates/sigtx v1.0.0
github.com/monoculum/formam v0.0.0-20200527175922-6f3cce7a46cf
github.com/monoculum/formam v0.0.0-20200905010316-d7a8fbd33677
github.com/sirupsen/logrus v1.5.0
github.com/spf13/cobra v0.0.6
github.com/spf13/pflag v1.0.5
Expand Down
8 changes: 4 additions & 4 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,8 @@ github.com/gobuffalo/flect v0.2.0 h1:EWCvMGGxOjsgwlWaP+f4+Hh6yrrte7JeFL2S6b+0hdM
github.com/gobuffalo/flect v0.2.0/go.mod h1:W3K3X9ksuZfir8f/LrfVtWmCDQFfayuylOJ7sz/Fj80=
github.com/gobuffalo/flect v0.2.1 h1:GPoRjEN0QObosV4XwuoWvSd5uSiL0N3e91/xqyY4crQ=
github.com/gobuffalo/flect v0.2.1/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc=
github.com/gobuffalo/flect v0.2.2 h1:PAVD7sp0KOdfswjAw9BpLCU9hXo7wFSzgpQ+zNeks/A=
github.com/gobuffalo/flect v0.2.2/go.mod h1:vmkQwuZYhN5Pc4ljYQZzP+1sq+NEkK+lh20jmEmX3jc=
github.com/gobuffalo/genny v0.0.0-20180924032338-7af3a40f2252/go.mod h1:tUTQOogrr7tAQnhajMSH6rv1BVev34H2sa1xNHMy94g=
github.com/gobuffalo/genny v0.0.0-20181003150629-3786a0744c5d/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM=
github.com/gobuffalo/genny v0.0.0-20181005145118-318a41a134cc/go.mod h1:WAd8HmjMVrnkAZbmfgH5dLBUchsZfqzp/WS5sQz+uTM=
Expand Down Expand Up @@ -868,10 +870,8 @@ github.com/monoculum/formam v0.0.0-20190730134247-0612307a4099/go.mod h1:JKa2av1
github.com/monoculum/formam v0.0.0-20190830100315-7ff9597b1407/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20191229172733-952f0766a724 h1:qlTmDrFZLQIGXnd1JE58dqyLnKyIJjR9WBeDQcT3O8w=
github.com/monoculum/formam v0.0.0-20191229172733-952f0766a724/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20200316225015-49f0baed3a1b h1:BvSZE/bUSz180cQzAEDVOh7seh57UNBlcGAte0CQ8l4=
github.com/monoculum/formam v0.0.0-20200316225015-49f0baed3a1b/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20200527175922-6f3cce7a46cf h1:DJ+VDi88ZNh+C3HkJlNtfWIeOdLPxFjbtwGbWa/D3sY=
github.com/monoculum/formam v0.0.0-20200527175922-6f3cce7a46cf/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/monoculum/formam v0.0.0-20200905010316-d7a8fbd33677 h1:N11HMdhT5DtkXsQQo3xPFipjvG7QwzKa9MBupRQqXaU=
github.com/monoculum/formam v0.0.0-20200905010316-d7a8fbd33677/go.mod h1:JKa2av1XVkGjhxdLS59nDoXa2JpmIHpnURWNbzCtXtc=
github.com/mwitkow/go-conntrack v0.0.0-20161129095857-cc309e4a2223/go.mod h1:qRWi+5nqEBWmkhHvq77mSJWrCKwh8bxhgT7d/eI7P4U=
github.com/neelance/astrewrite v0.0.0-20160511093645-99348263ae86/go.mod h1:kHJEU3ofeGjhHklVoIGuVj85JJwZ6kWPaJwCIxgnFmo=
github.com/neelance/sourcemap v0.0.0-20151028013722-8c68805598ab/go.mod h1:Qr6/a/Q4r9LP1IltGz7tA7iOK1WonHEYhu1HRBA7ZiM=
Expand Down
7 changes: 5 additions & 2 deletions render/js_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,9 @@ func Test_JavaScript_HTML_Partial(t *testing.T) {
bb := &bytes.Buffer{}

r.NoError(h.Render(bb, Data{}))
pre := `let a = "\x3Cdiv`
r.True(strings.HasPrefix(bb.String(), pre))
r.Contains(bb.String(), `id`)
r.Contains(bb.String(), `foo`)

// To check it has escaped the partial
r.NotContains(bb.String(), `<div id="foo">`)
}
2 changes: 1 addition & 1 deletion runtime/version.go
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package runtime

// Version is the current version of the buffalo binary
var Version = "v0.16.14"
var Version = "v0.16.15"