mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-08 00:22:14 +01:00
docs(godoc): fix a bunch of typos
This commit is contained in:
@@ -26,14 +26,14 @@ type client struct {
|
||||
}
|
||||
|
||||
// send call the webhook either to send the success response or the error response.
|
||||
func (c client) send(body io.Reader, headers map[string]string, erroed bool) error {
|
||||
func (c client) send(body io.Reader, headers map[string]string, errored bool) error {
|
||||
url := c.url
|
||||
if erroed {
|
||||
if errored {
|
||||
url = c.errorUrl
|
||||
}
|
||||
|
||||
method := c.method
|
||||
if erroed {
|
||||
if errored {
|
||||
method = c.errorMethod
|
||||
}
|
||||
|
||||
@@ -54,9 +54,9 @@ func (c client) send(body io.Reader, headers map[string]string, erroed bool) err
|
||||
contentLength, ok := headers[echo.HeaderContentLength]
|
||||
if ok {
|
||||
// Golang "http" package should automatically calculate the size of the
|
||||
// body. But, when using a buffered file reader, it does not work.
|
||||
// Worse, the "Content-Length" header is also removed. Therefore, in
|
||||
// order to keep this valuable information, we have to trust the caller
|
||||
// body. But when using a buffered file reader, it does not work.
|
||||
// Worse, the "Content-Length" header is also removed. Therefore,
|
||||
// to keep this valuable information, we have to trust the caller
|
||||
// by reading the value of the "Content-Length" entry and set it as the
|
||||
// content length of the request. It's kinda suboptimal, but hey, at
|
||||
// least it works.
|
||||
@@ -100,7 +100,7 @@ func (c client) send(body io.Reader, headers map[string]string, erroed bool) err
|
||||
fields[3] = zap.String("latency_human", finishTime.Sub(c.startTime).String())
|
||||
fields[4] = zap.Int64("bytes_out", req.ContentLength)
|
||||
|
||||
if erroed {
|
||||
if errored {
|
||||
c.logger.Warn("request to webhook with error details handled", fields...)
|
||||
|
||||
return nil
|
||||
|
||||
@@ -113,7 +113,7 @@ func webhookMiddleware(w *Webhook) api.Middleware {
|
||||
}
|
||||
}
|
||||
|
||||
// Retrieve values from echo.Context before it get recycled.
|
||||
// Retrieve values from echo.Context before it gets recycled.
|
||||
// See https://github.com/gotenberg/gotenberg/issues/1000.
|
||||
startTime := c.Get("startTime").(time.Time)
|
||||
traceHeader := c.Get("traceHeader").(string)
|
||||
@@ -189,7 +189,7 @@ func webhookMiddleware(w *Webhook) api.Middleware {
|
||||
return
|
||||
}
|
||||
|
||||
// No error, let's get build the output file.
|
||||
// No error, let's get to build the output file.
|
||||
outputPath, err := ctx.BuildOutputFile()
|
||||
if err != nil {
|
||||
ctx.Log().Error(fmt.Sprintf("build output file: %s", err))
|
||||
|
||||
@@ -14,7 +14,7 @@ func init() {
|
||||
gotenberg.MustRegisterModule(new(Webhook))
|
||||
}
|
||||
|
||||
// Webhook is a module which provides a middleware for uploading output files
|
||||
// Webhook is a module that provides a middleware for uploading output files
|
||||
// to any destinations in an asynchronous fashion.
|
||||
type Webhook struct {
|
||||
allowList *regexp2.Regexp
|
||||
|
||||
Reference in New Issue
Block a user