Skip to content
Toggle navigation
Toggle navigation
This project
Loading...
Sign in
张磊
/
FileStorageBeego
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Network
Create a new issue
Builds
Commits
Issue Boards
Files
Commits
Network
Compare
Branches
Tags
e4816718
authored
2013-12-19 13:07:43 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
_method also must support user defined router
1 parent
53b2a29b
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
6 additions
and
12 deletions
router.go
router.go
View file @
e481671
...
...
@@ -790,27 +790,21 @@ func (p *ControllerRegistor) getErrorHandler(errorCode string) func(rw http.Resp
func
(
p
*
ControllerRegistor
)
getRunMethod
(
method
string
,
context
*
beecontext
.
Context
,
router
*
controllerInfo
)
string
{
method
=
strings
.
ToLower
(
method
)
if
method
==
"post"
&&
strings
.
ToLower
(
context
.
Input
.
Query
(
"_method"
))
==
"put"
{
method
=
"put"
}
if
method
==
"post"
&&
strings
.
ToLower
(
context
.
Input
.
Query
(
"_method"
))
==
"delete"
{
method
=
"delete"
}
if
router
.
hasMethod
{
if
m
,
ok
:=
router
.
methods
[
method
];
ok
{
return
m
}
else
if
m
,
ok
=
router
.
methods
[
"*"
];
ok
{
return
m
}
else
{
if
method
==
"POST"
&&
strings
.
ToLower
(
context
.
Input
.
Query
(
"_method"
))
==
"put"
{
return
"Put"
}
if
method
==
"POST"
&&
strings
.
ToLower
(
context
.
Input
.
Query
(
"_method"
))
==
"delete"
{
return
"Delete"
}
return
strings
.
Title
(
method
)
}
}
else
{
if
method
==
"POST"
&&
strings
.
ToLower
(
context
.
Input
.
Query
(
"_method"
))
==
"put"
{
return
"Put"
}
if
method
==
"POST"
&&
strings
.
ToLower
(
context
.
Input
.
Query
(
"_method"
))
==
"delete"
{
return
"Delete"
}
return
strings
.
Title
(
method
)
}
}
...
...
Write
Preview
Styling with
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment