Added a config option to set Path attribute in Set-Cookie header.
This commit is contained in:
1 parent
ee9a35b9b3
commit
70b0dbad29
2 files changed
+7
-1
No files matched your search
@@ -49,6 +49,7 @@ options = {
|
|||||||
SESSION_TIMEOUT : {type : 'int', default : 30},
|
SESSION_TIMEOUT : {type : 'int', default : 30},
|
||||||
GET_PARAMETER_NAMES_DEPTH_THRESHOLD : {type : 'int', default : 0},
|
GET_PARAMETER_NAMES_DEPTH_THRESHOLD : {type : 'int', default : 0},
|
||||||
TASK_PARAMETERS_BATCH_SIZE : {type : 'int', default : 32},
|
TASK_PARAMETERS_BATCH_SIZE : {type : 'int', default : 32},
|
||||||
|
COOKIES_PATH : {type : 'string'},
|
||||||
|
|
||||||
# Libxml related configuration
|
# Libxml related configuration
|
||||||
XML_PARSE_RECOVER : {type : 'bool'},
|
XML_PARSE_RECOVER : {type : 'bool'},
|
||||||
|
|||||||
+6
-1
@@ -131,7 +131,12 @@ inform = (currentRequest, cwmpRequest) ->
|
|||||||
methodResponse : {type : 'InformResponse'},
|
methodResponse : {type : 'InformResponse'},
|
||||||
cwmpVersion : cwmpRequest.cwmpVersion
|
cwmpVersion : cwmpRequest.cwmpVersion
|
||||||
})
|
})
|
||||||
res.headers['Set-Cookie'] = "session=#{currentRequest.sessionId}"
|
|
||||||
|
if !!cookiesPath = config.get('COOKIES_PATH', currentRequest.session.deviceId)
|
||||||
|
res.headers['Set-Cookie'] = "session=#{currentRequest.sessionId}; Path=#{cookiesPath}"
|
||||||
|
else
|
||||||
|
res.headers['Set-Cookie'] = "session=#{currentRequest.sessionId}"
|
||||||
|
|
||||||
writeResponse(currentRequest, res)
|
writeResponse(currentRequest, res)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|||||||
Reference in new issue
Block a user