Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F8922152
handle-response.js
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
927 B
Referenced Files
None
Subscribers
None
handle-response.js
View Options
module
.
exports
=
function
(
app
,
context
,
h
)
{
const
config
=
app
.
ConfigManager
.
get
(
"www-server"
);
return
function
(
response
)
{
let
rep
=
null
;
if
(
response
instanceof
app
.
Sealious
.
File
)
{
rep
=
h
.
file
(
response
.
path_on_hdd
,
{
confine
:
false
})
.
type
(
response
.
mime
)
.
header
(
"Cache-Control"
,
"max-age=6000, must-revalidate"
);
}
else
if
(
response
instanceof
app
.
Sealious
.
Responses
.
NewSession
)
{
rep
=
h
.
response
(
response
)
.
state
(
config
[
"session-cookie-name"
],
response
.
metadata
.
session_id
);
}
else
if
(
response
instanceof
app
.
Sealious
.
Responses
.
ResourceCreated
)
{
rep
=
h
.
response
(
response
).
code
(
201
);
}
else
if
(
response
instanceof
app
.
Sealious
.
VirtualFile
)
{
rep
=
h
.
response
(
response
.
content
).
type
(
response
.
mime
);
}
else
{
rep
=
h
.
response
(
response
);
}
rep
.
state
(
config
[
"anonymous-cookie-name"
],
context
.
anonymous_session_id
);
return
rep
;
};
};
File Metadata
Details
Attached
Mime Type
text/x-asm
Expires
Sat, Sep 20, 14:19 (1 d, 13 h)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
925626
Default Alt Text
handle-response.js (927 B)
Attached To
Mode
rS Sealious
Attached
Detach File
Event Timeline
Log In to Comment