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
8674b81b
authored
2013-07-30 22:17:16 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix router & tpl tolower
1 parent
bce35c70
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
9 deletions
controller.go
router.go
controller.go
View file @
8674b81
...
...
@@ -156,7 +156,7 @@ func (c *Controller) RenderBytes() ([]byte, error) {
//if the controller has set layout, then first get the tplname's content set the content to the layout
if
c
.
Layout
!=
""
{
if
c
.
TplNames
==
""
{
c
.
TplNames
=
c
.
ChildName
+
"/"
+
c
.
Ctx
.
Request
.
Method
+
"."
+
c
.
TplExt
c
.
TplNames
=
c
.
ChildName
+
"/"
+
strings
.
ToLower
(
c
.
Ctx
.
Request
.
Method
)
+
"."
+
c
.
TplExt
}
if
RunMode
==
"dev"
{
BuildTemplate
(
ViewsPath
)
...
...
router.go
View file @
8674b81
...
...
@@ -373,14 +373,15 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
for
_
,
route
:=
range
p
.
fixrouters
{
n
:=
len
(
requestPath
)
//route like "/"
if
n
==
1
{
if
requestPath
==
route
.
pattern
{
runrouter
=
route
findrouter
=
true
break
}
else
{
continue
}
//if n == 1 {
// else {
// continue
// }
//}
if
requestPath
==
route
.
pattern
{
runrouter
=
route
findrouter
=
true
break
}
if
(
requestPath
[
n
-
1
]
!=
'/'
&&
route
.
pattern
==
requestPath
)
||
...
...
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