2702b745d5
Added the EditUser, EditUserEmail, EditUserPassword, EditUserGroup, EditUserGroupSuperMod and EditUserGroupAdmin permissions. Allocations are now tracked in the benchmarks. The topics template is now tracked in the benchmarks. The entire topic, topics, forum and forums routes are now benchmarked. Initial attempts to benchmark the router have begun, I'll probably have a benchmark in a later commit without the fluff so that it's easier to see it's performance impact. Improved the security on some of the moderation routes. SettingLabel is now OptionLabel for easier reuse. Moved one of the inline queries into a prepared statement. Added the initial draft for the new router. Fixed a bug where you lose all of your guest permissions when your session is invalidated.
31 lines
600 B
Go
31 lines
600 B
Go
package main
|
|
/*import "sync"
|
|
import "net/http"
|
|
|
|
type Router struct {
|
|
mu sync.RWMutex
|
|
routes map[string]http.Handler
|
|
}
|
|
|
|
func (route *Router) ServeHTTP() {
|
|
route.mu.RLock()
|
|
defer route.mu.RUnlock()
|
|
|
|
if path[0] != "/" {
|
|
return route.routes["/"]
|
|
}
|
|
|
|
// Do something on the path to turn slashes facing the wrong way "\" into "/" slashes. If it's bytes, then alter the bytes in place for the maximum speed
|
|
|
|
handle := route.routes[path]
|
|
if !ok {
|
|
if path[-1] != "/" {
|
|
handle = route.routes[path + "/"]
|
|
if !ok {
|
|
return route.routes["/"]
|
|
}
|
|
return handle
|
|
}
|
|
}
|
|
return handle
|
|
}*/ |