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

Commit 6de9f02

Browse files
author
Julien Neuhart
authoredOct 7, 2019
Merge pull request #7 from thecodingmachine/rpcc_message_too_large
adding googleChromeRpccBufferSize
2 parents d0b4062 + 8c7fdac commit 6de9f02

File tree

5 files changed

+21
-9
lines changed

5 files changed

+21
-9
lines changed
 

‎Makefile

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GOLANG_VERSION=1.13
2-
GOTENBERG_VERSION=6.0.0
2+
GOTENBERG_VERSION=6.0.1
33
VERSION=snapshot
44
GOLANGCI_LINT_VERSION=1.19.1
55

‎chrome.go

+14-8
Original file line numberDiff line numberDiff line change
@@ -6,14 +6,15 @@ import (
66
)
77

88
const (
9-
waitDelay string = "waitDelay"
10-
paperWidth string = "paperWidth"
11-
paperHeight string = "paperHeight"
12-
marginTop string = "marginTop"
13-
marginBottom string = "marginBottom"
14-
marginLeft string = "marginLeft"
15-
marginRight string = "marginRight"
16-
landscapeChrome string = "landscape"
9+
waitDelay string = "waitDelay"
10+
paperWidth string = "paperWidth"
11+
paperHeight string = "paperHeight"
12+
marginTop string = "marginTop"
13+
marginBottom string = "marginBottom"
14+
marginLeft string = "marginLeft"
15+
marginRight string = "marginRight"
16+
landscapeChrome string = "landscape"
17+
googleChromeRpccBufferSize string = "googleChromeRpccBufferSize"
1718
)
1819

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

102+
// GoogleChromeRpccBufferSize sets googleChromeRpccBufferSize form field.
103+
func (req *chromeRequest) GoogleChromeRpccBufferSize(bufferSize int64) {
104+
req.values[googleChromeRpccBufferSize] = strconv.FormatInt(bufferSize, 10)
105+
}
106+
101107
func (req *chromeRequest) formFiles() map[string]string {
102108
files := make(map[string]string)
103109
files["header.html"] = req.headerFilePath

‎html_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@ func TestHTML(t *testing.T) {
3030
req.PaperSize(A4)
3131
req.Margins(NormalMargins)
3232
req.Landscape(false)
33+
req.GoogleChromeRpccBufferSize(1048576)
3334
dirPath, err := test.Rand()
3435
require.Nil(t, err)
3536
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
@@ -47,6 +48,7 @@ func TestHTMLWithoutHeaderFooter(t *testing.T) {
4748
req.PaperSize(A4)
4849
req.Margins(NormalMargins)
4950
req.Landscape(false)
51+
req.GoogleChromeRpccBufferSize(1048576)
5052
dirPath, err := test.Rand()
5153
require.Nil(t, err)
5254
dest := fmt.Sprintf("%s/foo.pdf", dirPath)

‎markdown_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ func TestMarkdown(t *testing.T) {
3535
req.PaperSize(A4)
3636
req.Margins(NormalMargins)
3737
req.Landscape(false)
38+
req.GoogleChromeRpccBufferSize(1048576)
3839
dirPath, err := test.Rand()
3940
require.Nil(t, err)
4041
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
@@ -57,6 +58,7 @@ func TestMarkdownWithoutHeaderFooter(t *testing.T) {
5758
req.PaperSize(A4)
5859
req.Margins(NormalMargins)
5960
req.Landscape(false)
61+
req.GoogleChromeRpccBufferSize(1048576)
6062
dirPath, err := test.Rand()
6163
require.Nil(t, err)
6264
dest := fmt.Sprintf("%s/foo.pdf", dirPath)

‎url_test.go

+2
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,7 @@ func TestURL(t *testing.T) {
2323
req.PaperSize(A4)
2424
req.Margins(NormalMargins)
2525
req.Landscape(false)
26+
req.GoogleChromeRpccBufferSize(1048576)
2627
dirPath, err := test.Rand()
2728
require.Nil(t, err)
2829
dest := fmt.Sprintf("%s/foo.pdf", dirPath)
@@ -39,6 +40,7 @@ func TestURLWithoutHeaderFooter(t *testing.T) {
3940
req.PaperSize(A4)
4041
req.Margins(NormalMargins)
4142
req.Landscape(false)
43+
req.GoogleChromeRpccBufferSize(1048576)
4244
dirPath, err := test.Rand()
4345
require.Nil(t, err)
4446
dest := fmt.Sprintf("%s/foo.pdf", dirPath)

0 commit comments

Comments
 (0)