mirror of
https://github.com/gotenberg/gotenberg.git
synced 2026-08-17 20:52:14 +01:00
fixing method HasResource
This commit is contained in:
@@ -3,6 +3,7 @@ package context
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
"reflect"
|
||||||
"strconv"
|
"strconv"
|
||||||
"time"
|
"time"
|
||||||
|
|
||||||
@@ -124,6 +125,12 @@ func (ctx *Context) WithResource(directoryName string) error {
|
|||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// HasResource returns true if the Context
|
||||||
|
// has a resource.Resource.
|
||||||
|
func (ctx Context) HasResource() bool {
|
||||||
|
return !reflect.DeepEqual(ctx.resource, resource.Resource{})
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
MustResource returns the resource.Resource
|
MustResource returns the resource.Resource
|
||||||
associated with the Context.
|
associated with the Context.
|
||||||
@@ -138,12 +145,6 @@ func (ctx Context) MustResource() resource.Resource {
|
|||||||
return ctx.resource
|
return ctx.resource
|
||||||
}
|
}
|
||||||
|
|
||||||
// HasResource returns true if the Context
|
|
||||||
// has a resource.Resource.
|
|
||||||
func (ctx Context) HasResource() bool {
|
|
||||||
return &ctx.resource != nil
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
LogRequestResult logs the result of a request.
|
LogRequestResult logs the result of a request.
|
||||||
This method should only be used by a middleware!
|
This method should only be used by a middleware!
|
||||||
|
|||||||
Reference in New Issue
Block a user