File tree Expand file tree Collapse file tree 1 file changed +0
-22
lines changed
src/main/java/org/radarbase/management/web/rest/util Expand file tree Collapse file tree 1 file changed +0
-22
lines changed Original file line number Diff line number Diff line change @@ -100,26 +100,4 @@ object HeaderUtil {
100100 }
101101 .reduce { a: String , b: String -> java.lang.String .join(" /" , a, b) }
102102 }
103-
104-
105-
106- /* *
107- * Custom cookie parser as the httprequest.cookies method cuts off '='.
108- */
109- fun parseCookies (cookieHeader : String? ): List <Cookie > {
110- val result: List <Cookie > = listOf ()
111- if (cookieHeader != null ) {
112- val cookiesRaw = cookieHeader.split(" ; " .toRegex()).dropLastWhile { it.isEmpty() }
113- .toTypedArray()
114- return cookiesRaw.map{
115- val parts = it.split(" =" .toRegex(), limit = 2 ).toTypedArray()
116- var value = if (parts.size > 1 ) parts[1 ] else " "
117- if (value.length >= 2 && value.startsWith(" \" " ) && value.endsWith(" \" " )) {
118- value = value.substring(1 , value.length - 1 )
119- }
120- Cookie (name = parts[0 ], value = parts[1 ])
121- }.toList()
122- }
123- return result
124- }
125103}
You can’t perform that action at this time.
0 commit comments