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
0b659961
authored
2013-12-24 15:27:00 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
clearly the router, If user set the third params, will not follow the RESTful method
1 parent
fc19f8f1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
12 additions
and
8 deletions
router.go
router.go
View file @
0b65996
...
...
@@ -566,10 +566,12 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
for
_
,
route
:=
range
p
.
fixrouters
{
n
:=
len
(
requestPath
)
if
requestPath
==
route
.
pattern
{
runrouter
=
route
.
controllerType
findrouter
=
true
runMethod
=
p
.
getRunMethod
(
r
.
Method
,
context
,
route
)
break
if
runMethod
!=
""
{
runrouter
=
route
.
controllerType
findrouter
=
true
break
}
}
// pattern /admin url /admin 200 /admin/ 404
// pattern /admin/ url /admin 301 /admin/ 200
...
...
@@ -608,11 +610,13 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
//reassemble query params and add to RawQuery
r
.
URL
.
RawQuery
=
url
.
Values
(
values
)
.
Encode
()
}
runrouter
=
route
.
controllerType
findrouter
=
true
context
.
Input
.
Params
=
params
runMethod
=
p
.
getRunMethod
(
r
.
Method
,
context
,
route
)
break
if
runMethod
!=
""
{
runrouter
=
route
.
controllerType
context
.
Input
.
Params
=
params
findrouter
=
true
break
}
}
}
...
...
@@ -798,7 +802,7 @@ func (p *ControllerRegistor) getRunMethod(method string, context *beecontext.Con
}
else
if
m
,
ok
=
router
.
methods
[
"*"
];
ok
{
return
m
}
else
{
return
strings
.
Title
(
method
)
return
""
}
}
else
{
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