Updated MinecraftAuth (jjwt)

This commit is contained in:
RaphiMC 2023-10-15 10:19:59 +02:00
parent 12550e332c
commit 175c24d320
No known key found for this signature in database
GPG key ID: 0F6BB0657A03AC94
2 changed files with 1 additions and 44 deletions

View file

@ -89,7 +89,7 @@ dependencies {
include "net.lenni0451:Reflect:1.3.0"
include "net.lenni0451:LambdaEvents:2.3.0"
include "net.raphimc.netminecraft:all:2.3.7-SNAPSHOT"
include("net.raphimc:MinecraftAuth:2.1.6-SNAPSHOT") {
include("net.raphimc:MinecraftAuth:2.1.7-SNAPSHOT") {
exclude group: "com.google.code.gson", module: "gson"
exclude group: "org.slf4j", module: "slf4j-api"
}

View file

@ -1,43 +0,0 @@
/*
* This file is part of ViaProxy - https://github.com/RaphiMC/ViaProxy
* Copyright (C) 2023 RK_01/RaphiMC and contributors
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
package net.raphimc.viaproxy.injection.transformer;
import io.jsonwebtoken.impl.ParameterMap;
import io.jsonwebtoken.lang.Strings;
import net.lenni0451.classtransform.annotations.CTarget;
import net.lenni0451.classtransform.annotations.CTransformer;
import net.lenni0451.classtransform.annotations.injection.COverride;
import net.lenni0451.classtransform.annotations.injection.CRedirect;
@CTransformer(ParameterMap.class)
public abstract class ParameterMapTransformer {
@CRedirect(method = {"apply", "nullSafePut"}, target = @CTarget(value = "INVOKE", target = "Lio/jsonwebtoken/lang/Objects;isEmpty(Ljava/lang/Object;)Z"))
private boolean allowEmptyValues(final Object value) {
return value == null;
}
@COverride
private static Object clean(Object o) {
if (o instanceof String) {
o = Strings.trimWhitespace((String) o);
}
return o;
}
}