public class io.netty.handler.codec.http.cors.CorsHandler extends io.netty.channel.ChannelDuplexHandler
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: io.netty.handler.codec.http.cors.CorsHandler
super_class: io.netty.channel.ChannelDuplexHandler
{
private static final io.netty.util.internal.logging.InternalLogger logger;
descriptor: Lio/netty/util/internal/logging/InternalLogger;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
private static final java.lang.String ANY_ORIGIN;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "*"
private static final java.lang.String NULL_ORIGIN;
descriptor: Ljava/lang/String;
flags: (0x001a) ACC_PRIVATE, ACC_STATIC, ACC_FINAL
ConstantValue: "null"
private io.netty.handler.codec.http.cors.CorsConfig config;
descriptor: Lio/netty/handler/codec/http/cors/CorsConfig;
flags: (0x0002) ACC_PRIVATE
private io.netty.handler.codec.http.HttpRequest request;
descriptor: Lio/netty/handler/codec/http/HttpRequest;
flags: (0x0002) ACC_PRIVATE
private final java.util.List<io.netty.handler.codec.http.cors.CorsConfig> configList;
descriptor: Ljava/util/List;
flags: (0x0012) ACC_PRIVATE, ACC_FINAL
Signature: Ljava/util/List<Lio/netty/handler/codec/http/cors/CorsConfig;>;
private boolean isShortCircuit;
descriptor: Z
flags: (0x0002) ACC_PRIVATE
static void <clinit>();
descriptor: ()V
flags: (0x0008) ACC_STATIC
Code:
stack=1, locals=0, args_size=0
0: ldc Lio/netty/handler/codec/http/cors/CorsHandler;
invokestatic io.netty.util.internal.logging.InternalLoggerFactory.getInstance:(Ljava/lang/Class;)Lio/netty/util/internal/logging/InternalLogger;
putstatic io.netty.handler.codec.http.cors.CorsHandler.logger:Lio/netty/util/internal/logging/InternalLogger;
1: return
LocalVariableTable:
Start End Slot Name Signature
public void <init>(io.netty.handler.codec.http.cors.CorsConfig);
descriptor: (Lio/netty/handler/codec/http/cors/CorsConfig;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
aload 1
ldc "config"
invokestatic io.netty.util.internal.ObjectUtil.checkNotNull:(Ljava/lang/Object;Ljava/lang/String;)Ljava/lang/Object;
checkcast io.netty.handler.codec.http.cors.CorsConfig
invokestatic java.util.Collections.singletonList:(Ljava/lang/Object;)Ljava/util/List;
aload 1
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isShortCircuit:()Z
invokespecial io.netty.handler.codec.http.cors.CorsHandler.<init>:(Ljava/util/List;Z)V
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 2 1 config Lio/netty/handler/codec/http/cors/CorsConfig;
MethodParameters:
Name Flags
config final
public void <init>(java.util.List<io.netty.handler.codec.http.cors.CorsConfig>, );
descriptor: (Ljava/util/List;Z)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=2, locals=3, args_size=3
start local 0 start local 1 start local 2 0: aload 0
invokespecial io.netty.channel.ChannelDuplexHandler.<init>:()V
1: aload 1
ldc "configList"
invokestatic io.netty.util.internal.ObjectUtil.checkNonEmpty:(Ljava/util/Collection;Ljava/lang/String;)Ljava/util/Collection;
pop
2: aload 0
aload 1
putfield io.netty.handler.codec.http.cors.CorsHandler.configList:Ljava/util/List;
3: aload 0
iload 2
putfield io.netty.handler.codec.http.cors.CorsHandler.isShortCircuit:Z
4: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 5 1 configList Ljava/util/List<Lio/netty/handler/codec/http/cors/CorsConfig;>;
0 5 2 isShortCircuit Z
Signature: (Ljava/util/List<Lio/netty/handler/codec/http/cors/CorsConfig;>;Z)V
MethodParameters:
Name Flags
configList final
isShortCircuit
public void channelRead(io.netty.channel.ChannelHandlerContext, java.lang.Object);
descriptor: (Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=4, args_size=3
start local 0 start local 1 start local 2 0: aload 2
instanceof io.netty.handler.codec.http.HttpRequest
ifeq 10
1: aload 0
aload 2
checkcast io.netty.handler.codec.http.HttpRequest
putfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
2: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
invokeinterface io.netty.handler.codec.http.HttpRequest.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ORIGIN:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.get:(Ljava/lang/CharSequence;)Ljava/lang/String;
astore 3
start local 3 3: aload 0
aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.getForOrigin:(Ljava/lang/String;)Lio/netty/handler/codec/http/cors/CorsConfig;
putfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
4: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
invokestatic io.netty.handler.codec.http.cors.CorsHandler.isPreflightRequest:(Lio/netty/handler/codec/http/HttpRequest;)Z
ifeq 7
5: aload 0
aload 1
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.handlePreflight:(Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;)V
6: return
7: StackMap locals: java.lang.String
StackMap stack:
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.isShortCircuit:Z
ifeq 10
aload 3
ifnull 10
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
ifnonnull 10
8: aload 1
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
invokestatic io.netty.handler.codec.http.cors.CorsHandler.forbidden:(Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;)V
9: return
end local 3 10: StackMap locals:
StackMap stack:
aload 1
aload 2
invokeinterface io.netty.channel.ChannelHandlerContext.fireChannelRead:(Ljava/lang/Object;)Lio/netty/channel/ChannelHandlerContext;
pop
11: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 12 1 ctx Lio/netty/channel/ChannelHandlerContext;
0 12 2 msg Ljava/lang/Object;
3 10 3 origin Ljava/lang/String;
Exceptions:
throws java.lang.Exception
MethodParameters:
Name Flags
ctx final
msg final
private void handlePreflight(io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.http.HttpRequest);
descriptor: (Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=6, locals=4, args_size=3
start local 0 start local 1 start local 2 0: new io.netty.handler.codec.http.DefaultFullHttpResponse
dup
aload 2
invokeinterface io.netty.handler.codec.http.HttpRequest.protocolVersion:()Lio/netty/handler/codec/http/HttpVersion;
getstatic io.netty.handler.codec.http.HttpResponseStatus.OK:Lio/netty/handler/codec/http/HttpResponseStatus;
iconst_1
iconst_1
invokespecial io.netty.handler.codec.http.DefaultFullHttpResponse.<init>:(Lio/netty/handler/codec/http/HttpVersion;Lio/netty/handler/codec/http/HttpResponseStatus;ZZ)V
astore 3
start local 3 1: aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setOrigin:(Lio/netty/handler/codec/http/HttpResponse;)Z
ifeq 7
2: aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setAllowMethods:(Lio/netty/handler/codec/http/HttpResponse;)V
3: aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setAllowHeaders:(Lio/netty/handler/codec/http/HttpResponse;)V
4: aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setAllowCredentials:(Lio/netty/handler/codec/http/HttpResponse;)V
5: aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setMaxAge:(Lio/netty/handler/codec/http/HttpResponse;)V
6: aload 0
aload 3
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setPreflightHeaders:(Lio/netty/handler/codec/http/HttpResponse;)V
7: StackMap locals: io.netty.handler.codec.http.HttpResponse
StackMap stack:
aload 3
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.contains:(Ljava/lang/CharSequence;)Z
ifne 9
8: aload 3
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH:Lio/netty/util/AsciiString;
getstatic io.netty.handler.codec.http.HttpHeaderValues.ZERO:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Object;)Lio/netty/handler/codec/http/HttpHeaders;
pop
9: StackMap locals:
StackMap stack:
aload 2
invokestatic io.netty.util.ReferenceCountUtil.release:(Ljava/lang/Object;)Z
pop
10: aload 1
aload 2
aload 3
invokestatic io.netty.handler.codec.http.cors.CorsHandler.respond:(Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;Lio/netty/handler/codec/http/HttpResponse;)V
11: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 12 1 ctx Lio/netty/channel/ChannelHandlerContext;
0 12 2 request Lio/netty/handler/codec/http/HttpRequest;
1 12 3 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
ctx final
request final
private void setPreflightHeaders(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.preflightResponseHeaders:()Lio/netty/handler/codec/http/HttpHeaders;
invokevirtual io.netty.handler.codec.http.HttpHeaders.add:(Lio/netty/handler/codec/http/HttpHeaders;)Lio/netty/handler/codec/http/HttpHeaders;
pop
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 2 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private io.netty.handler.codec.http.cors.CorsConfig getForOrigin(java.lang.String);
descriptor: (Ljava/lang/String;)Lio/netty/handler/codec/http/cors/CorsConfig;
flags: (0x0002) ACC_PRIVATE
Code:
stack=2, locals=4, args_size=2
start local 0 start local 1 0: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.configList:Ljava/util/List;
invokeinterface java.util.List.iterator:()Ljava/util/Iterator;
astore 3
goto 8
StackMap locals: io.netty.handler.codec.http.cors.CorsHandler java.lang.String top java.util.Iterator
StackMap stack:
1: aload 3
invokeinterface java.util.Iterator.next:()Ljava/lang/Object;
checkcast io.netty.handler.codec.http.cors.CorsConfig
astore 2
start local 2 2: aload 2
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isAnyOriginSupported:()Z
ifeq 4
3: aload 2
areturn
4: StackMap locals: io.netty.handler.codec.http.cors.CorsHandler java.lang.String io.netty.handler.codec.http.cors.CorsConfig java.util.Iterator
StackMap stack:
aload 2
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.origins:()Ljava/util/Set;
aload 1
invokeinterface java.util.Set.contains:(Ljava/lang/Object;)Z
ifeq 6
5: aload 2
areturn
6: StackMap locals:
StackMap stack:
aload 2
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isNullOriginAllowed:()Z
ifne 7
ldc "null"
aload 1
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 8
7: StackMap locals:
StackMap stack:
aload 2
areturn
end local 2 8: StackMap locals: io.netty.handler.codec.http.cors.CorsHandler java.lang.String top java.util.Iterator
StackMap stack:
aload 3
invokeinterface java.util.Iterator.hasNext:()Z
ifne 1
9: aconst_null
areturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 10 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 10 1 requestOrigin Ljava/lang/String;
2 8 2 corsConfig Lio/netty/handler/codec/http/cors/CorsConfig;
MethodParameters:
Name Flags
requestOrigin
private boolean setOrigin(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)Z
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
invokeinterface io.netty.handler.codec.http.HttpRequest.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ORIGIN:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.get:(Ljava/lang/CharSequence;)Ljava/lang/String;
astore 2
start local 2 1: aload 2
ifnull 17
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
ifnull 17
2: ldc "null"
aload 2
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 5
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isNullOriginAllowed:()Z
ifeq 5
3: aload 1
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setNullOrigin:(Lio/netty/handler/codec/http/HttpResponse;)V
4: iconst_1
ireturn
5: StackMap locals: java.lang.String
StackMap stack:
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isAnyOriginSupported:()Z
ifeq 12
6: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isCredentialsAllowed:()Z
ifeq 10
7: aload 0
aload 1
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.echoRequestOrigin:(Lio/netty/handler/codec/http/HttpResponse;)V
8: aload 1
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setVaryHeader:(Lio/netty/handler/codec/http/HttpResponse;)V
9: goto 11
10: StackMap locals:
StackMap stack:
aload 1
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setAnyOrigin:(Lio/netty/handler/codec/http/HttpResponse;)V
11: StackMap locals:
StackMap stack:
iconst_1
ireturn
12: StackMap locals:
StackMap stack:
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.origins:()Ljava/util/Set;
aload 2
invokeinterface java.util.Set.contains:(Ljava/lang/Object;)Z
ifeq 16
13: aload 1
aload 2
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setOrigin:(Lio/netty/handler/codec/http/HttpResponse;Ljava/lang/String;)V
14: aload 1
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setVaryHeader:(Lio/netty/handler/codec/http/HttpResponse;)V
15: iconst_1
ireturn
16: StackMap locals:
StackMap stack:
getstatic io.netty.handler.codec.http.cors.CorsHandler.logger:Lio/netty/util/internal/logging/InternalLogger;
ldc "Request origin [{}]] was not among the configured origins [{}]"
aload 2
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.origins:()Ljava/util/Set;
invokeinterface io.netty.util.internal.logging.InternalLogger.debug:(Ljava/lang/String;Ljava/lang/Object;Ljava/lang/Object;)V
17: StackMap locals:
StackMap stack:
iconst_0
ireturn
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 18 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 18 1 response Lio/netty/handler/codec/http/HttpResponse;
1 18 2 origin Ljava/lang/String;
MethodParameters:
Name Flags
response final
private void echoRequestOrigin(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 1
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.request:Lio/netty/handler/codec/http/HttpRequest;
invokeinterface io.netty.handler.codec.http.HttpRequest.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ORIGIN:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.get:(Ljava/lang/CharSequence;)Ljava/lang/String;
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setOrigin:(Lio/netty/handler/codec/http/HttpResponse;Ljava/lang/String;)V
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 2 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private static void setVaryHeader(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=1, args_size=1
start local 0 0: aload 0
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.VARY:Lio/netty/util/AsciiString;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ORIGIN:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Object;)Lio/netty/handler/codec/http/HttpHeaders;
pop
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private static void setAnyOrigin(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
ldc "*"
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setOrigin:(Lio/netty/handler/codec/http/HttpResponse;Ljava/lang/String;)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private static void setNullOrigin(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
ldc "null"
invokestatic io.netty.handler.codec.http.cors.CorsHandler.setOrigin:(Lio/netty/handler/codec/http/HttpResponse;Ljava/lang/String;)V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private static void setOrigin(io.netty.handler.codec.http.HttpResponse, java.lang.String);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;Ljava/lang/String;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN:Lio/netty/util/AsciiString;
aload 1
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Object;)Lio/netty/handler/codec/http/HttpHeaders;
pop
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 response Lio/netty/handler/codec/http/HttpResponse;
0 2 1 origin Ljava/lang/String;
MethodParameters:
Name Flags
response final
origin final
private void setAllowCredentials(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isCredentialsAllowed:()Z
ifeq 3
1: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_ALLOW_ORIGIN:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.get:(Ljava/lang/CharSequence;)Ljava/lang/String;
ldc "*"
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 3
2: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_ALLOW_CREDENTIALS:Lio/netty/util/AsciiString;
ldc "true"
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Object;)Lio/netty/handler/codec/http/HttpHeaders;
pop
3: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 4 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 4 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private static boolean isPreflightRequest(io.netty.handler.codec.http.HttpRequest);
descriptor: (Lio/netty/handler/codec/http/HttpRequest;)Z
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=2, args_size=1
start local 0 0: aload 0
invokeinterface io.netty.handler.codec.http.HttpRequest.headers:()Lio/netty/handler/codec/http/HttpHeaders;
astore 1
start local 1 1: aload 0
invokeinterface io.netty.handler.codec.http.HttpRequest.method:()Lio/netty/handler/codec/http/HttpMethod;
getstatic io.netty.handler.codec.http.HttpMethod.OPTIONS:Lio/netty/handler/codec/http/HttpMethod;
invokevirtual io.netty.handler.codec.http.HttpMethod.equals:(Ljava/lang/Object;)Z
ifeq 5
2: aload 1
getstatic io.netty.handler.codec.http.HttpHeaderNames.ORIGIN:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.contains:(Ljava/lang/CharSequence;)Z
ifeq 5
3: aload 1
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_REQUEST_METHOD:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.contains:(Ljava/lang/CharSequence;)Z
ifeq 5
4: iconst_1
ireturn
StackMap locals: io.netty.handler.codec.http.HttpHeaders
StackMap stack:
5: iconst_0
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 request Lio/netty/handler/codec/http/HttpRequest;
1 6 1 headers Lio/netty/handler/codec/http/HttpHeaders;
MethodParameters:
Name Flags
request final
private void setExposeHeaders(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.exposedHeaders:()Ljava/util/Set;
invokeinterface java.util.Set.isEmpty:()Z
ifne 2
1: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_EXPOSE_HEADERS:Lio/netty/util/AsciiString;
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.exposedHeaders:()Ljava/util/Set;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Lio/netty/handler/codec/http/HttpHeaders;
pop
2: StackMap locals:
StackMap stack:
return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 3 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 3 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private void setAllowMethods(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_ALLOW_METHODS:Lio/netty/util/AsciiString;
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.allowedRequestMethods:()Ljava/util/Set;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Lio/netty/handler/codec/http/HttpHeaders;
pop
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 2 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private void setAllowHeaders(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=3, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_ALLOW_HEADERS:Lio/netty/util/AsciiString;
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.allowedRequestHeaders:()Ljava/util/Set;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Iterable;)Lio/netty/handler/codec/http/HttpHeaders;
pop
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 2 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
private void setMaxAge(io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x0002) ACC_PRIVATE
Code:
stack=4, locals=2, args_size=2
start local 0 start local 1 0: aload 1
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.ACCESS_CONTROL_MAX_AGE:Lio/netty/util/AsciiString;
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.maxAge:()J
invokestatic java.lang.Long.valueOf:(J)Ljava/lang/Long;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Object;)Lio/netty/handler/codec/http/HttpHeaders;
pop
1: return
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 2 1 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
response final
public void write(io.netty.channel.ChannelHandlerContext, java.lang.Object, io.netty.channel.ChannelPromise);
descriptor: (Lio/netty/channel/ChannelHandlerContext;Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)V
flags: (0x0001) ACC_PUBLIC
Code:
stack=3, locals=5, args_size=4
start local 0 start local 1 start local 2 start local 3 0: aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
ifnull 5
aload 0
getfield io.netty.handler.codec.http.cors.CorsHandler.config:Lio/netty/handler/codec/http/cors/CorsConfig;
invokevirtual io.netty.handler.codec.http.cors.CorsConfig.isCorsSupportEnabled:()Z
ifeq 5
aload 2
instanceof io.netty.handler.codec.http.HttpResponse
ifeq 5
1: aload 2
checkcast io.netty.handler.codec.http.HttpResponse
astore 4
start local 4 2: aload 0
aload 4
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setOrigin:(Lio/netty/handler/codec/http/HttpResponse;)Z
ifeq 5
3: aload 0
aload 4
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setAllowCredentials:(Lio/netty/handler/codec/http/HttpResponse;)V
4: aload 0
aload 4
invokevirtual io.netty.handler.codec.http.cors.CorsHandler.setExposeHeaders:(Lio/netty/handler/codec/http/HttpResponse;)V
end local 4 5: StackMap locals:
StackMap stack:
aload 1
aload 2
aload 3
invokeinterface io.netty.channel.ChannelHandlerContext.write:(Ljava/lang/Object;Lio/netty/channel/ChannelPromise;)Lio/netty/channel/ChannelFuture;
pop
6: return
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 7 0 this Lio/netty/handler/codec/http/cors/CorsHandler;
0 7 1 ctx Lio/netty/channel/ChannelHandlerContext;
0 7 2 msg Ljava/lang/Object;
0 7 3 promise Lio/netty/channel/ChannelPromise;
2 5 4 response Lio/netty/handler/codec/http/HttpResponse;
Exceptions:
throws java.lang.Exception
MethodParameters:
Name Flags
ctx final
msg final
promise final
private static void forbidden(io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.http.HttpRequest);
descriptor: (Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=4, locals=3, args_size=2
start local 0 start local 1 0: new io.netty.handler.codec.http.DefaultFullHttpResponse
dup
aload 1
invokeinterface io.netty.handler.codec.http.HttpRequest.protocolVersion:()Lio/netty/handler/codec/http/HttpVersion;
getstatic io.netty.handler.codec.http.HttpResponseStatus.FORBIDDEN:Lio/netty/handler/codec/http/HttpResponseStatus;
invokespecial io.netty.handler.codec.http.DefaultFullHttpResponse.<init>:(Lio/netty/handler/codec/http/HttpVersion;Lio/netty/handler/codec/http/HttpResponseStatus;)V
astore 2
start local 2 1: aload 2
invokeinterface io.netty.handler.codec.http.HttpResponse.headers:()Lio/netty/handler/codec/http/HttpHeaders;
getstatic io.netty.handler.codec.http.HttpHeaderNames.CONTENT_LENGTH:Lio/netty/util/AsciiString;
getstatic io.netty.handler.codec.http.HttpHeaderValues.ZERO:Lio/netty/util/AsciiString;
invokevirtual io.netty.handler.codec.http.HttpHeaders.set:(Ljava/lang/CharSequence;Ljava/lang/Object;)Lio/netty/handler/codec/http/HttpHeaders;
pop
2: aload 1
invokestatic io.netty.util.ReferenceCountUtil.release:(Ljava/lang/Object;)Z
pop
3: aload 0
aload 1
aload 2
invokestatic io.netty.handler.codec.http.cors.CorsHandler.respond:(Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;Lio/netty/handler/codec/http/HttpResponse;)V
4: return
end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 5 0 ctx Lio/netty/channel/ChannelHandlerContext;
0 5 1 request Lio/netty/handler/codec/http/HttpRequest;
1 5 2 response Lio/netty/handler/codec/http/HttpResponse;
MethodParameters:
Name Flags
ctx final
request final
private static void respond(io.netty.channel.ChannelHandlerContext, io.netty.handler.codec.http.HttpRequest, io.netty.handler.codec.http.HttpResponse);
descriptor: (Lio/netty/channel/ChannelHandlerContext;Lio/netty/handler/codec/http/HttpRequest;Lio/netty/handler/codec/http/HttpResponse;)V
flags: (0x000a) ACC_PRIVATE, ACC_STATIC
Code:
stack=2, locals=5, args_size=3
start local 0 start local 1 start local 2 0: aload 1
invokestatic io.netty.handler.codec.http.HttpUtil.isKeepAlive:(Lio/netty/handler/codec/http/HttpMessage;)Z
istore 3
start local 3 1: aload 2
iload 3
invokestatic io.netty.handler.codec.http.HttpUtil.setKeepAlive:(Lio/netty/handler/codec/http/HttpMessage;Z)V
2: aload 0
aload 2
invokeinterface io.netty.channel.ChannelHandlerContext.writeAndFlush:(Ljava/lang/Object;)Lio/netty/channel/ChannelFuture;
astore 4
start local 4 3: iload 3
ifne 5
4: aload 4
getstatic io.netty.channel.ChannelFutureListener.CLOSE:Lio/netty/channel/ChannelFutureListener;
invokeinterface io.netty.channel.ChannelFuture.addListener:(Lio/netty/util/concurrent/GenericFutureListener;)Lio/netty/channel/ChannelFuture;
pop
5: StackMap locals: int io.netty.channel.ChannelFuture
StackMap stack:
return
end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 6 0 ctx Lio/netty/channel/ChannelHandlerContext;
0 6 1 request Lio/netty/handler/codec/http/HttpRequest;
0 6 2 response Lio/netty/handler/codec/http/HttpResponse;
1 6 3 keepAlive Z
3 6 4 future Lio/netty/channel/ChannelFuture;
MethodParameters:
Name Flags
ctx final
request final
response final
}
SourceFile: "CorsHandler.java"