File tree 1 file changed +5
-5
lines changed
1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -16,20 +16,20 @@ type requestBody struct {
16
16
Args []string `json:"args"`
17
17
}
18
18
19
- func htmlToPdf (w http.ResponseWriter , r * http.Request ) {
20
- if r .Method != "POST" {
19
+ func htmlToPdf (w http.ResponseWriter , req * http.Request ) {
20
+ if req .Method != "POST" {
21
21
http .Error (w , "Invalid request method" , http .StatusMethodNotAllowed )
22
22
return
23
23
}
24
24
25
- if ! strings .HasPrefix (r .Header .Get ("Content-Type" ), "application/json" ) {
25
+ if ! strings .HasPrefix (req .Header .Get ("Content-Type" ), "application/json" ) {
26
26
http .Error (w , "Invalid content type" , http .StatusUnsupportedMediaType )
27
27
return
28
28
}
29
29
30
30
var b requestBody
31
31
32
- err := json .NewDecoder (r .Body ).Decode (& b )
32
+ err := json .NewDecoder (req .Body ).Decode (& b )
33
33
if err != nil {
34
34
http .Error (w , err .Error (), http .StatusBadRequest )
35
35
return
@@ -58,7 +58,7 @@ func htmlToPdf(w http.ResponseWriter, r *http.Request) {
58
58
return
59
59
}
60
60
61
- http .ServeFile (w , r , pdfPath )
61
+ http .ServeFile (w , req , pdfPath )
62
62
}
63
63
64
64
func main () {
You can’t perform that action at this time.
0 commit comments