File tree Expand file tree Collapse file tree 1 file changed +9
-0
lines changed
Expand file tree Collapse file tree 1 file changed +9
-0
lines changed Original file line number Diff line number Diff line change @@ -34,6 +34,7 @@ var HTTPSnippet = function (req, lang) {
3434 // construct query string object
3535 this . source . queryObj = { }
3636 this . source . headersObj = { }
37+ this . source . cookiesObj = { }
3738 this . source . allHeaders = { }
3839 this . source . postData . jsonObj = false
3940 this . source . postData . paramsObj = false
@@ -54,6 +55,14 @@ var HTTPSnippet = function (req, lang) {
5455 } , { } )
5556 }
5657
58+ // construct headers objects
59+ if ( this . source . cookies && this . source . cookies . length ) {
60+ this . source . cookiesObj = this . source . cookies . reduceRight ( function ( cookies , cookie ) {
61+ cookies [ cookie . name ] = cookie . value
62+ return cookies
63+ } , { } )
64+ }
65+
5766 // construct Cookie header
5867 var cookies = this . source . cookies . map ( function ( cookie ) {
5968 return encodeURIComponent ( cookie . name ) + '=' + encodeURIComponent ( cookie . value )
You can’t perform that action at this time.
0 commit comments