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

Commit

Permalink
Merge pull request #7 from thecodingmachine/rpcc_message_too_large
Browse files Browse the repository at this point in the history
adding googleChromeRpccBufferSize
  • Loading branch information
gulien authored Oct 7, 2019
2 parents d0b4062 + 8c7fdac commit 6de9f02
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 9 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
GOLANG_VERSION=1.13
GOTENBERG_VERSION=6.0.0
GOTENBERG_VERSION=6.0.1
VERSION=snapshot
GOLANGCI_LINT_VERSION=1.19.1

Expand Down
22 changes: 14 additions & 8 deletions chrome.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,14 +6,15 @@ import (
)

const (
waitDelay string = "waitDelay"
paperWidth string = "paperWidth"
paperHeight string = "paperHeight"
marginTop string = "marginTop"
marginBottom string = "marginBottom"
marginLeft string = "marginLeft"
marginRight string = "marginRight"
landscapeChrome string = "landscape"
waitDelay string = "waitDelay"
paperWidth string = "paperWidth"
paperHeight string = "paperHeight"
marginTop string = "marginTop"
marginBottom string = "marginBottom"
marginLeft string = "marginLeft"
marginRight string = "marginRight"
landscapeChrome string = "landscape"
googleChromeRpccBufferSize string = "googleChromeRpccBufferSize"
)

// nolint: gochecknoglobals
Expand Down Expand Up @@ -98,6 +99,11 @@ func (req *chromeRequest) Landscape(isLandscape bool) {
req.values[landscapeChrome] = strconv.FormatBool(isLandscape)
}

// GoogleChromeRpccBufferSize sets googleChromeRpccBufferSize form field.
func (req *chromeRequest) GoogleChromeRpccBufferSize(bufferSize int64) {
req.values[googleChromeRpccBufferSize] = strconv.FormatInt(bufferSize, 10)
}

func (req *chromeRequest) formFiles() map[string]string {
files := make(map[string]string)
files["header.html"] = req.headerFilePath
Expand Down
2 changes: 2 additions & 0 deletions html_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@ func TestHTML(t *testing.T) {
req.PaperSize(A4)
req.Margins(NormalMargins)
req.Landscape(false)
req.GoogleChromeRpccBufferSize(1048576)
dirPath, err := test.Rand()
require.Nil(t, err)
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
Expand All @@ -47,6 +48,7 @@ func TestHTMLWithoutHeaderFooter(t *testing.T) {
req.PaperSize(A4)
req.Margins(NormalMargins)
req.Landscape(false)
req.GoogleChromeRpccBufferSize(1048576)
dirPath, err := test.Rand()
require.Nil(t, err)
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
Expand Down
2 changes: 2 additions & 0 deletions markdown_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ func TestMarkdown(t *testing.T) {
req.PaperSize(A4)
req.Margins(NormalMargins)
req.Landscape(false)
req.GoogleChromeRpccBufferSize(1048576)
dirPath, err := test.Rand()
require.Nil(t, err)
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
Expand All @@ -57,6 +58,7 @@ func TestMarkdownWithoutHeaderFooter(t *testing.T) {
req.PaperSize(A4)
req.Margins(NormalMargins)
req.Landscape(false)
req.GoogleChromeRpccBufferSize(1048576)
dirPath, err := test.Rand()
require.Nil(t, err)
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
Expand Down
2 changes: 2 additions & 0 deletions url_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ func TestURL(t *testing.T) {
req.PaperSize(A4)
req.Margins(NormalMargins)
req.Landscape(false)
req.GoogleChromeRpccBufferSize(1048576)
dirPath, err := test.Rand()
require.Nil(t, err)
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
Expand All @@ -39,6 +40,7 @@ func TestURLWithoutHeaderFooter(t *testing.T) {
req.PaperSize(A4)
req.Margins(NormalMargins)
req.Landscape(false)
req.GoogleChromeRpccBufferSize(1048576)
dirPath, err := test.Rand()
require.Nil(t, err)
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
Expand Down

0 comments on commit 6de9f02

Please sign in to comment.