update naming of functions, add option to get count of unread messages of user
This commit is contained in:
@@ -11,23 +11,23 @@ import (
|
||||
type postType uint8
|
||||
|
||||
const (
|
||||
postNormal postType = iota
|
||||
postFile
|
||||
postAvatar
|
||||
postProfileBg
|
||||
normal postType = iota
|
||||
file
|
||||
avatar
|
||||
profileBg
|
||||
)
|
||||
|
||||
func validCheckWithResponseOnFail(response *http.ResponseWriter, request *http.Request, pt postType) bool {
|
||||
var maxSize int64
|
||||
switch pt {
|
||||
case postFile:
|
||||
maxSize = int64(globals.MaxPostWithFileBytes)
|
||||
case postAvatar:
|
||||
maxSize = int64(globals.MaxPostWithAvatar)
|
||||
case postProfileBg:
|
||||
maxSize = int64(globals.MaxPostWithProfileBg)
|
||||
case file:
|
||||
maxSize = int64(globals.MaxRequestWithFileBytes)
|
||||
case avatar:
|
||||
maxSize = int64(globals.MaxRequestWithAvatarBytes)
|
||||
case profileBg:
|
||||
maxSize = int64(globals.MaxRequestWithProfileBgBytes)
|
||||
default:
|
||||
maxSize = int64(globals.MaxPostBytes)
|
||||
maxSize = int64(globals.MaxRequestBytes)
|
||||
}
|
||||
|
||||
if request.ContentLength > maxSize {
|
||||
|
||||
Reference in New Issue
Block a user