Skip to content

Commit

Permalink
Fix range handling
Browse files Browse the repository at this point in the history
  • Loading branch information
Timothée Peignier committed Feb 28, 2017
1 parent f11ab45 commit f79bea5
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ package heroku
Or using ``go generate``:

```
//go:generate schematic -o heroku/heroku.go platform-api.json
//go:generate schematic -o heroku/heroku.go platform-api.json
```

## Client Usage
Expand Down Expand Up @@ -151,5 +151,5 @@ Schematic bundles templated Go code into a Go source file via the
the Go source file after changing .tmpl files:

```console
$ templates -source schema/templates/ > schema/templates/templates.go
$ templates -s templates/ - templates/templates.go
```
4 changes: 2 additions & 2 deletions templates/service.tmpl
Original file line number Diff line number Diff line change
Expand Up @@ -146,12 +146,12 @@ func (lr *ListRange) SetHeader(req *http.Request) {
if lr.Max != 0 {
hdrval += fmt.Sprintf("; max=%d", lr.Max)
if lr.Descending {
hdrval += ", "
hdrval += "; "
}
}

if lr.Descending {
hdrval += ", order=desc"
hdrval += "order=desc"
}

req.Header.Set("Range", hdrval)
Expand Down
5 changes: 3 additions & 2 deletions templates/templates.go
Original file line number Diff line number Diff line change
Expand Up @@ -198,12 +198,12 @@ func (lr *ListRange) SetHeader(req *http.Request) {
if lr.Max != 0 {
hdrval += fmt.Sprintf("; max=%d", lr.Max)
if lr.Descending {
hdrval += ", "
hdrval += "; "
}
}
if lr.Descending {
hdrval += ", order=desc"
hdrval += "order=desc"
}
req.Header.Set("Range", hdrval)
Expand Down Expand Up @@ -261,3 +261,4 @@ func Parse(t *template.Template) (*template.Template, error) {
}
return t, nil
}

0 comments on commit f79bea5

Please sign in to comment.