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
24cf06d2
authored
2015-02-23 11:15:55 +0800
by
fuxiaohei
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
code style simplify for context package
1 parent
f988f035
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
7 additions
and
4 deletions
context/context.go
context/input.go
context/context.go
View file @
24cf06d
...
...
@@ -155,8 +155,11 @@ func (ctx *Context) CheckXsrfCookie() bool {
}
if
token
==
""
{
ctx
.
Abort
(
403
,
"'_xsrf' argument missing from POST"
)
}
else
if
ctx
.
_xsrf_token
!=
token
{
return
false
}
if
ctx
.
_xsrf_token
!=
token
{
ctx
.
Abort
(
403
,
"XSRF cookie does not match POST argument"
)
return
false
}
return
true
}
...
...
context/input.go
View file @
24cf06d
...
...
@@ -72,11 +72,11 @@ func (input *BeegoInput) Site() string {
func
(
input
*
BeegoInput
)
Scheme
()
string
{
if
input
.
Request
.
URL
.
Scheme
!=
""
{
return
input
.
Request
.
URL
.
Scheme
}
else
if
input
.
Request
.
TLS
==
nil
{
}
if
input
.
Request
.
TLS
==
nil
{
return
"http"
}
else
{
return
"https"
}
return
"https"
}
// Domain returns host name.
...
...
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