Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
B
beego
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
beego
Commits
efc14a1e
Commit
efc14a1e
authored
Oct 16, 2014
by
WithGJR
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix router bug with more better way
parent
fa128100
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
7 deletions
+3
-7
router.go
router.go
+3
-7
No files found.
router.go
View file @
efc14a1e
...
@@ -648,20 +648,16 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
...
@@ -648,20 +648,16 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
}
}
if
!
findrouter
{
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"
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"
http_method
=
"DELETE"
}
}
if
http_method
!=
"PUT"
&&
http_method
!=
"DELETE"
{
http_method
=
r
.
Method
}
if
t
,
ok
:=
p
.
routers
[
http_method
];
ok
{
if
t
,
ok
:=
p
.
routers
[
http_method
];
ok
{
runObject
,
p
:=
t
.
Match
(
urlPath
)
runObject
,
p
:=
t
.
Match
(
urlPath
)
if
r
,
ok
:=
runObject
.
(
*
controllerInfo
);
ok
{
if
r
,
ok
:=
runObject
.
(
*
controllerInfo
);
ok
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment