Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

merge contributions #246

Merged
merged 5 commits into from
May 9, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
15 changes: 11 additions & 4 deletions .circleci/test-setup.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,20 +7,27 @@ set -ex
# Install Ponzu CMS
go get -u github.com/ponzu-cms/ponzu/...


# test install
ponzu


# create a project and generate code
ponzu new github.com/ponzu-cms/ci/test-project
if [ $CIRCLE_BRANCH = "ponzu-dev" ]; then
# ensure we have the latest from ponzu-dev branch
cd /go/src/github.com/ponzu-cms/ponzu
git checkout ponzu-dev
git pull origin ponzu-dev

# create new project using the ponzu-dev branch
ponzu new --dev github.com/ponzu-cms/ci/test-project
else
ponzu new github.com/ponzu-cms/ci/test-project
fi

cd /go/src/github.com/ponzu-cms/ci/test-project

ponzu gen content person name:string hashed_secret:string
ponzu gen content message from:@person,hashed_secret to:@person,hashed_secret


# build and run dev http/2 server with TLS
ponzu build

3 changes: 2 additions & 1 deletion cmd/ponzu/add.go
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,8 @@ var addCmd = &cobra.Command{
Aliases: []string{"a"},
Short: "Downloads addon from specified import path",
Long: `Downloads addon from specified import path to $GOPATH/src and copys it to the
current project's addons directory. Must be called from within a Ponzu project directory.`,
current project's addons directory. Must be called from within a Ponzu project directory. Addon
needs to imported in at least one content item for it to be included in the Ponzu server build.`,
Example: `$ ponzu add github.com/bosssauce/fbscheduler`,
RunE: func(cmd *cobra.Command, args []string) error {
// expecting two args, add/a and the go gettable package uri
Expand Down
2 changes: 1 addition & 1 deletion docs/src/Quickstart/Overview.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ $ cd $GOPATH/src/github.com/nilslice/reviews

5) Generate content type file and boilerplate code (creates `content/review.go`):
```bash
$ ponzu generate content review title:"string" author:"string" rating:"float64" body:"string":richtext website_url:"string" items:"[]string" photo:string:file`
$ ponzu generate content review title:"string" author:"string" rating:"float64" body:"string":richtext website_url:"string" items:"[]string" photo:string:file
```

6) Build your project:
Expand Down
9 changes: 7 additions & 2 deletions system/api/push.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,15 @@ package api
import (
"log"
"net/http"
"strings"

"github.com/ponzu-cms/ponzu/system/item"

"github.com/tidwall/gjson"
"golang.org/x/net/http2"
)

const errRecursivePush = "recursive push not allowed"

func push(res http.ResponseWriter, req *http.Request, pt interface{}, data []byte) {
// Push(target string, opts *PushOptions) error
if pusher, ok := res.(http.Pusher); ok {
Expand Down Expand Up @@ -40,7 +42,10 @@ func push(res http.ResponseWriter, req *http.Request, pt interface{}, data []byt
err := pusher.Push(v.String(), nil)
// check for error, "http2: recursive push not allowed"
// and return, suppressing a log message
if err != nil && err.Error() == http2.ErrRecursivePush.Error() {
// XXX: errRecursivePush has been co-located to this
// package instead of importing golang.org/x/net/http2
// to get the error itself.
if err != nil && strings.Contains(err.Error(), errRecursivePush) {
return true
}
if err != nil {
Expand Down