Search in sources :

Example 11 with ParametersAreNonnullByDefault

use of javax.annotation.ParametersAreNonnullByDefault in project FlareBot by FlareBot.

the class GzipRequestInterceptor method intercept.

@Override
@ParametersAreNonnullByDefault
public Response intercept(Chain chain) throws IOException {
    Request originalRequest = chain.request();
    if (originalRequest.body() == null || originalRequest.header("Content-Encoding") == null || !originalRequest.header("Content-Encoding").equals("gzip")) {
        return chain.proceed(originalRequest);
    }
    Request compressedRequest = originalRequest.newBuilder().method(originalRequest.method(), gzip(originalRequest.body())).build();
    return chain.proceed(compressedRequest);
}
Also used : Request(okhttp3.Request) ParametersAreNonnullByDefault(javax.annotation.ParametersAreNonnullByDefault)

Aggregations

ParametersAreNonnullByDefault (javax.annotation.ParametersAreNonnullByDefault)11 ItemStack (net.minecraft.item.ItemStack)4 AxisAlignedTransform2D (ivorius.ivtoolkit.math.AxisAlignedTransform2D)2 GenerationType (ivorius.reccomplex.world.gen.feature.structure.generic.generation.GenerationType)2 ArrayList (java.util.ArrayList)2 Nonnull (javax.annotation.Nonnull)2 Entity (net.minecraft.entity.Entity)2 EntityLivingBase (net.minecraft.entity.EntityLivingBase)2 EntityPlayer (net.minecraft.entity.player.EntityPlayer)2 AxisAlignedBB (net.minecraft.util.math.AxisAlignedBB)2 BlockPos (net.minecraft.util.math.BlockPos)2 WorldServer (net.minecraft.world.WorldServer)2 BlockAbstractTurretHead (omtteam.openmodularturrets.blocks.turretheads.BlockAbstractTurretHead)2 NormalDamageSource (omtteam.openmodularturrets.entity.projectiles.damagesources.NormalDamageSource)2 ResultSet (com.datastax.driver.core.ResultSet)1 Row (com.datastax.driver.core.Row)1 TreeTraverser (com.google.common.collect.TreeTraverser)1 JSONConfig (io.github.binaryoverload.JSONConfig)1 BlockSurfacePos (ivorius.ivtoolkit.blocks.BlockSurfacePos)1 SelectionOwner (ivorius.reccomplex.capability.SelectionOwner)1