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
896c258e
Commit
896c258e
authored
Apr 30, 2018
by
Waleed Gadelkareem
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Log redirects and abort after redirect
parent
33bf80b0
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
2 additions
and
2 deletions
+2
-2
controller.go
controller.go
+2
-0
accesslog.go
logs/accesslog.go
+0
-2
No files found.
controller.go
View file @
896c258e
...
...
@@ -272,7 +272,9 @@ func (c *Controller) viewPath() string {
// Redirect sends the redirection response to url with status code.
func
(
c
*
Controller
)
Redirect
(
url
string
,
code
int
)
{
logAccess
(
c
.
Ctx
,
nil
,
code
)
c
.
Ctx
.
Redirect
(
code
,
url
)
panic
(
ErrAbort
)
}
// Abort stops controller handler and show the error data if code is defined in ErrorMap or code string.
...
...
logs/accesslog.go
View file @
896c258e
...
...
@@ -64,9 +64,7 @@ func disableEscapeHTML(i interface{}) {
// AccessLog - Format and print access log.
func
AccessLog
(
r
*
AccessLogRecord
,
format
string
)
{
var
msg
string
switch
format
{
case
apacheFormat
:
timeFormatted
:=
r
.
RequestTime
.
Format
(
"02/Jan/2006 03:04:05"
)
msg
=
fmt
.
Sprintf
(
apacheFormatPattern
,
r
.
RemoteAddr
,
timeFormatted
,
r
.
Request
,
r
.
Status
,
r
.
BodyBytesSent
,
...
...
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