Skip to content

Commit

Permalink
[YouTube] Fix music mixes in some countries
Browse files Browse the repository at this point in the history
  • Loading branch information
Stypox committed Mar 1, 2022
1 parent 69e18c8 commit dd8687f
Showing 1 changed file with 6 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -988,10 +988,13 @@ public static String generateConsentCookie() {
public static String extractCookieValue(final String cookieName,
@Nonnull final Response response) {
final List<String> cookies = response.responseHeaders().get("set-cookie");
int startIndex;
String result = "";
if (cookies == null) {
return EMPTY_STRING;
}

String result = EMPTY_STRING;
for (final String cookie : cookies) {
startIndex = cookie.indexOf(cookieName);
final int startIndex = cookie.indexOf(cookieName);
if (startIndex != -1) {
result = cookie.substring(startIndex + cookieName.length() + "=".length(),
cookie.indexOf(";", startIndex));
Expand Down

0 comments on commit dd8687f

Please sign in to comment.