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
6c92ca2a
authored
2014-03-12 17:03:34 +0800
by
asta.xie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix bug for static file like /static /static_js /static_css
1 parent
217c3a2e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
8 additions
and
3 deletions
router.go
router.go
View file @
6c92ca2
...
...
@@ -548,11 +548,16 @@ func (p *ControllerRegistor) ServeHTTP(rw http.ResponseWriter, r *http.Request)
for
prefix
,
staticDir
:=
range
StaticDir
{
if
r
.
URL
.
Path
==
"/favicon.ico"
{
file
:=
path
.
Join
(
staticDir
,
r
.
URL
.
Path
)
http
.
ServeFile
(
w
,
r
,
file
)
w
.
started
=
true
goto
Admin
if
utils
.
FileExists
(
file
)
{
http
.
ServeFile
(
w
,
r
,
file
)
w
.
started
=
true
goto
Admin
}
}
if
strings
.
HasPrefix
(
r
.
URL
.
Path
,
prefix
)
{
if
len
(
r
.
URL
.
Path
)
>
len
(
prefix
)
&&
r
.
URL
.
Path
[
len
(
prefix
)
+
1
]
!=
'/'
{
continue
}
file
:=
path
.
Join
(
staticDir
,
r
.
URL
.
Path
[
len
(
prefix
)
:
])
finfo
,
err
:=
os
.
Stat
(
file
)
if
err
!=
nil
{
...
...
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