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
a85d91b4
authored
2013-09-19 23:04:05 +0800
by
astaxie
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
fix #206
1 parent
a616087c
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
2 deletions
flash.go
flash.go
View file @
a85d91b
...
...
@@ -6,6 +6,8 @@ import (
"strings"
)
const
BEEGO_FLASH_SEP
=
"#BEEGOFLASH#"
type
FlashData
struct
{
Data
map
[
string
]
string
}
...
...
@@ -44,7 +46,7 @@ func (fd *FlashData) Store(c *Controller) {
c
.
Data
[
"flash"
]
=
fd
.
Data
var
flashValue
string
for
key
,
value
:=
range
fd
.
Data
{
flashValue
+=
"
\x00
"
+
key
+
":"
+
value
+
"
\x00
"
flashValue
+=
"
\x00
"
+
key
+
BEEGO_FLASH_SEP
+
value
+
"
\x00
"
}
c
.
Ctx
.
SetCookie
(
"BEEGO_FLASH"
,
url
.
QueryEscape
(
flashValue
),
0
,
"/"
)
}
...
...
@@ -58,7 +60,7 @@ func ReadFromRequest(c *Controller) *FlashData {
vals
:=
strings
.
Split
(
v
,
"
\x00
"
)
for
_
,
v
:=
range
vals
{
if
len
(
v
)
>
0
{
kv
:=
strings
.
Split
(
v
,
":"
)
kv
:=
strings
.
Split
(
v
,
BEEGO_FLASH_SEP
)
if
len
(
kv
)
==
2
{
flash
.
Data
[
kv
[
0
]]
=
kv
[
1
]
}
...
...
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