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
465ed4b7
authored
2013-04-09 23:51:19 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix router's bug
1 parent
2f02653b
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
6 deletions
router.go
router.go
View file @
465ed4b
...
...
@@ -51,12 +51,12 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface) {
//match /post/:username:word ([\w]+)
}
else
if
lindex
:=
strings
.
LastIndex
(
part
,
":"
);
lindex
!=
0
{
switch
part
[
lindex
:
]
{
case
"int"
:
case
"
:
int"
:
expr
=
"([0-9]+)"
part
=
part
[
:
index
]
case
"word"
:
part
=
part
[
:
l
index
]
case
"
:
word"
:
expr
=
`([\w]+)`
part
=
part
[
:
index
]
part
=
part
[
:
l
index
]
}
}
params
[
j
]
=
part
...
...
@@ -67,10 +67,9 @@ func (p *ControllerRegistor) Add(pattern string, c ControllerInterface) {
expr
:=
"(.+)"
if
part
==
"*.*"
{
params
[
j
]
=
":path"
parts
[
j
]
=
"([^.]+).
"
parts
[
i
]
=
"([^.]+).([^.]+)
"
j
++
params
[
j
]
=
":ext"
parts
[
j
]
=
"([^.]+)"
j
++
}
else
{
params
[
j
]
=
":splat"
...
...
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