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
efc14a1e
authored
2014-10-16 18:58:12 +0800
by
WithGJR
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix router bug with more better way
1 parent
fa128100
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
router.go
router.go
View file @
efc14a1
...
...
@@ -648,20 +648,16 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
if
!
findrouter
{
http_method
:=
""
http_method
:=
r
.
Method
if
r
.
M
ethod
==
"POST"
&&
context
.
Input
.
Query
(
"_method"
)
==
"PUT"
{
if
http_m
ethod
==
"POST"
&&
context
.
Input
.
Query
(
"_method"
)
==
"PUT"
{
http_method
=
"PUT"
}
if
r
.
M
ethod
==
"POST"
&&
context
.
Input
.
Query
(
"_method"
)
==
"DELETE"
{
if
http_m
ethod
==
"POST"
&&
context
.
Input
.
Query
(
"_method"
)
==
"DELETE"
{
http_method
=
"DELETE"
}
if
http_method
!=
"PUT"
&&
http_method
!=
"DELETE"
{
http_method
=
r
.
Method
}
if
t
,
ok
:=
p
.
routers
[
http_method
];
ok
{
runObject
,
p
:=
t
.
Match
(
urlPath
)
if
r
,
ok
:=
runObject
.
(
*
controllerInfo
);
ok
{
...
...
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