This repository was archived by the owner on Apr 14, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 4 files changed +26
-14
lines changed Expand file tree Collapse file tree 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) {
101101func (req * chromeRequest ) GoogleChromeRpccBufferSize (bufferSize int64 ) {
102102 req .values [googleChromeRpccBufferSize ] = strconv .FormatInt (bufferSize , 10 )
103103}
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 {
2626func (req * HTMLRequest ) formFiles () map [string ]Document {
2727 files := make (map [string ]Document )
2828 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+ }
2935 for _ , asset := range req .assets {
3036 files [asset .Filename ()] = asset
3137 }
Original file line number Diff line number Diff line change @@ -30,6 +30,12 @@ func (req *MarkdownRequest) formFiles() map[string]Document {
3030 for _ , markdown := range req .markdowns {
3131 files [markdown .Filename ()] = markdown
3232 }
33+ if req .header != nil {
34+ files ["header.html" ] = req .header
35+ }
36+ if req .footer != nil {
37+ files ["footer.html" ] = req .footer
38+ }
3339 for _ , asset := range req .assets {
3440 files [asset .Filename ()] = asset
3541 }
Original file line number Diff line number Diff line change @@ -20,14 +20,25 @@ func NewURLRequest(url string) *URLRequest {
2020 return req
2121}
2222
23- func (url * URLRequest ) postURL () string {
23+ func (req * URLRequest ) postURL () string {
2424 return "/convert/url"
2525}
2626
2727// AddRemoteURLHTTPHeader add a remote URL custom HTTP header.
28- func (url * URLRequest ) AddRemoteURLHTTPHeader (key , value string ) {
28+ func (req * URLRequest ) AddRemoteURLHTTPHeader (key , value string ) {
2929 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
3142}
3243
3344// Compile-time checks to ensure type implements desired interfaces.
You can’t perform that action at this time.
0 commit comments