mirror of
https://github.com/superseriousbusiness/gotosocial.git
synced 2025-10-29 04:22:24 -05:00
move constants
This commit is contained in:
parent
21d54e6939
commit
1b7e341ac4
2 changed files with 6 additions and 21 deletions
|
|
@ -150,11 +150,6 @@ func isHeaderBlocked(state *state.State, c *gin.Context) (bool, error) {
|
|||
}
|
||||
|
||||
if key != "" {
|
||||
// if expr != "" {
|
||||
// // TODO: replace expvar with build
|
||||
// // taggable metrics types in State{}.
|
||||
// }
|
||||
|
||||
// A header was matched against!
|
||||
// i.e. this request is blocked.
|
||||
return true, nil
|
||||
|
|
@ -185,11 +180,6 @@ func isHeaderAllowed(state *state.State, c *gin.Context) (bool, error) {
|
|||
}
|
||||
|
||||
if key != "" {
|
||||
// if expr != "" {
|
||||
// // TODO: replace expvar with build
|
||||
// // taggable metrics types in State{}.
|
||||
// }
|
||||
|
||||
// A header was matched against!
|
||||
// i.e. this request is allowed.
|
||||
return true, nil
|
||||
|
|
@ -220,11 +210,6 @@ func isHeaderNotAllowed(state *state.State, c *gin.Context) (bool, error) {
|
|||
}
|
||||
|
||||
if key != "" {
|
||||
// if expr != "" {
|
||||
// // TODO: replace expvar with build
|
||||
// // taggable metrics types in State{}.
|
||||
// }
|
||||
|
||||
// A header was matched against!
|
||||
// i.e. request is NOT allowed.
|
||||
return true, nil
|
||||
|
|
|
|||
|
|
@ -71,12 +71,6 @@ func NoLLaMas(getInstanceV1 func(context.Context) (*apimodel.InstanceV1, gtserro
|
|||
return nollamas.Serve
|
||||
}
|
||||
|
||||
// i.e. outputted hash slice length.
|
||||
const hashLen = sha256.Size
|
||||
|
||||
// i.e. hex.EncodedLen(hashLen).
|
||||
const encodedHashLen = 2 * hashLen
|
||||
|
||||
// hashWithBufs encompasses a hash along
|
||||
// with the necessary buffers to generate
|
||||
// a hashsum and then encode that sum.
|
||||
|
|
@ -111,6 +105,12 @@ func (m *nollamas) Serve(c *gin.Context) {
|
|||
return
|
||||
}
|
||||
|
||||
// i.e. outputted hash slice length.
|
||||
const hashLen = sha256.Size
|
||||
|
||||
// i.e. hex.EncodedLen(hashLen).
|
||||
const encodedHashLen = 2 * hashLen
|
||||
|
||||
// Prepare hash + buffers.
|
||||
hash := hashWithBufs{
|
||||
hash: sha256.New(),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue