forked from goffee/core
Implemented a thread-safe solution to the race condition that was causing random route overlaps
This commit is contained in:
parent
850d2ae477
commit
e8f7ab40b5
2 changed files with 74 additions and 17 deletions
|
|
@ -54,7 +54,11 @@ func (c *Context) Next() {
|
|||
}
|
||||
|
||||
func (c *Context) prepare(ctx *Context) {
|
||||
ctx.Request.httpRequest.ParseMultipartForm(int64(app.Config.Request.MaxUploadFileSize))
|
||||
// Only parse multipart form if it hasn't been parsed already
|
||||
// This prevents race conditions when multiple goroutines might access the same request
|
||||
if ctx.Request.httpRequest.MultipartForm == nil {
|
||||
ctx.Request.httpRequest.ParseMultipartForm(int64(app.Config.Request.MaxUploadFileSize))
|
||||
}
|
||||
}
|
||||
|
||||
func (c *Context) GetPathParam(key string) interface{} {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue