This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree 4 files changed +26
-14
lines changed
4 files changed +26
-14
lines changed Original file line number Diff line number Diff line change @@ -101,14 +101,3 @@ func (req *chromeRequest) PageRanges(ranges string) {
101
101
func (req * chromeRequest ) GoogleChromeRpccBufferSize (bufferSize int64 ) {
102
102
req .values [googleChromeRpccBufferSize ] = strconv .FormatInt (bufferSize , 10 )
103
103
}
104
-
105
- func (req * chromeRequest ) formFiles () map [string ]Document {
106
- files := make (map [string ]Document )
107
- if req .header != nil {
108
- files ["header.html" ] = req .header
109
- }
110
- if req .footer != nil {
111
- files ["footer.html" ] = req .footer
112
- }
113
- return files
114
- }
Original file line number Diff line number Diff line change @@ -26,6 +26,12 @@ func (req *HTMLRequest) postURL() string {
26
26
func (req * HTMLRequest ) formFiles () map [string ]Document {
27
27
files := make (map [string ]Document )
28
28
files ["index.html" ] = req .index
29
+ if req .header != nil {
30
+ files ["header.html" ] = req .header
31
+ }
32
+ if req .footer != nil {
33
+ files ["footer.html" ] = req .footer
34
+ }
29
35
for _ , asset := range req .assets {
30
36
files [asset .Filename ()] = asset
31
37
}
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ func (req *MarkdownRequest) formFiles() map[string]Document {
30
30
for _ , markdown := range req .markdowns {
31
31
files [markdown .Filename ()] = markdown
32
32
}
33
+ if req .header != nil {
34
+ files ["header.html" ] = req .header
35
+ }
36
+ if req .footer != nil {
37
+ files ["footer.html" ] = req .footer
38
+ }
33
39
for _ , asset := range req .assets {
34
40
files [asset .Filename ()] = asset
35
41
}
Original file line number Diff line number Diff line change @@ -20,14 +20,25 @@ func NewURLRequest(url string) *URLRequest {
20
20
return req
21
21
}
22
22
23
- func (url * URLRequest ) postURL () string {
23
+ func (req * URLRequest ) postURL () string {
24
24
return "/convert/url"
25
25
}
26
26
27
27
// AddRemoteURLHTTPHeader add a remote URL custom HTTP header.
28
- func (url * URLRequest ) AddRemoteURLHTTPHeader (key , value string ) {
28
+ func (req * URLRequest ) AddRemoteURLHTTPHeader (key , value string ) {
29
29
key = fmt .Sprintf ("%s%s" , remoteURLBaseHTTPHeaderKey , key )
30
- url .httpHeaders [key ] = value
30
+ req .httpHeaders [key ] = value
31
+ }
32
+
33
+ func (req * URLRequest ) formFiles () map [string ]Document {
34
+ files := make (map [string ]Document )
35
+ if req .header != nil {
36
+ files ["header.html" ] = req .header
37
+ }
38
+ if req .footer != nil {
39
+ files ["footer.html" ] = req .footer
40
+ }
41
+ return files
31
42
}
32
43
33
44
// Compile-time checks to ensure type implements desired interfaces.
You can’t perform that action at this time.
0 commit comments