public class org.apache.tomcat.util.http.RequestUtil
minor version: 0
major version: 59
flags: flags: (0x0021) ACC_PUBLIC, ACC_SUPER
this_class: org.apache.tomcat.util.http.RequestUtil
super_class: java.lang.Object
{
private void <init>();
descriptor: ()V
flags: (0x0002) ACC_PRIVATE
Code:
stack=1, locals=1, args_size=1
start local 0 0: aload 0
invokespecial java.lang.Object.<init>:()V
1: return
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 2 0 this Lorg/apache/tomcat/util/http/RequestUtil;
public static java.lang.String normalize(java.lang.String);
descriptor: (Ljava/lang/String;)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=1, args_size=1
start local 0 0: aload 0
iconst_1
invokestatic org.apache.tomcat.util.http.RequestUtil.normalize:(Ljava/lang/String;Z)Ljava/lang/String;
areturn
end local 0 LocalVariableTable:
Start End Slot Name Signature
0 1 0 path Ljava/lang/String;
MethodParameters:
Name Flags
path
public static java.lang.String normalize(java.lang.String, boolean);
descriptor: (Ljava/lang/String;Z)Ljava/lang/String;
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=5, locals=6, args_size=2
start local 0 start local 1 0: aload 0
ifnonnull 2
1: aconst_null
areturn
2: StackMap locals:
StackMap stack:
aload 0
astore 2
start local 2 3: iload 1
ifeq 5
aload 2
bipush 92
invokevirtual java.lang.String.indexOf:(I)I
iflt 5
4: aload 2
bipush 92
bipush 47
invokevirtual java.lang.String.replace:(CC)Ljava/lang/String;
astore 2
5: StackMap locals: java.lang.String
StackMap stack:
aload 2
ldc "/"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifne 7
6: new java.lang.StringBuilder
dup
ldc "/"
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 2
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
7: StackMap locals:
StackMap stack:
iconst_0
istore 3
start local 3 8: aload 2
ldc "/."
invokevirtual java.lang.String.endsWith:(Ljava/lang/String;)Z
ifne 9
aload 2
ldc "/.."
invokevirtual java.lang.String.endsWith:(Ljava/lang/String;)Z
ifeq 11
9: StackMap locals: int
StackMap stack:
new java.lang.StringBuilder
dup
aload 2
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
ldc "/"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
10: iconst_1
istore 3
11: StackMap locals:
StackMap stack:
aload 2
ldc "//"
invokevirtual java.lang.String.indexOf:(Ljava/lang/String;)I
istore 4
start local 4 12: iload 4
ifge 14
13: goto 16
14: StackMap locals: int
StackMap stack:
new java.lang.StringBuilder
dup
aload 2
iconst_0
iload 4
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 2
iload 4
iconst_1
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
end local 4 15: goto 11
16: StackMap locals:
StackMap stack:
aload 2
ldc "/./"
invokevirtual java.lang.String.indexOf:(Ljava/lang/String;)I
istore 4
start local 4 17: iload 4
ifge 19
18: goto 21
19: StackMap locals: int
StackMap stack:
new java.lang.StringBuilder
dup
aload 2
iconst_0
iload 4
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 2
iload 4
iconst_2
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
end local 4 20: goto 16
21: StackMap locals:
StackMap stack:
aload 2
ldc "/../"
invokevirtual java.lang.String.indexOf:(Ljava/lang/String;)I
istore 4
start local 4 22: iload 4
ifge 24
23: goto 29
24: StackMap locals: int
StackMap stack:
iload 4
ifne 26
25: aconst_null
areturn
26: StackMap locals:
StackMap stack:
aload 2
bipush 47
iload 4
iconst_1
isub
invokevirtual java.lang.String.lastIndexOf:(II)I
istore 5
start local 5 27: new java.lang.StringBuilder
dup
aload 2
iconst_0
iload 5
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
invokestatic java.lang.String.valueOf:(Ljava/lang/Object;)Ljava/lang/String;
invokespecial java.lang.StringBuilder.<init>:(Ljava/lang/String;)V
aload 2
iload 4
iconst_3
iadd
invokevirtual java.lang.String.substring:(I)Ljava/lang/String;
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
astore 2
end local 5 end local 4 28: goto 21
29: StackMap locals:
StackMap stack:
aload 2
invokevirtual java.lang.String.length:()I
iconst_1
if_icmple 31
iload 3
ifeq 31
30: aload 2
iconst_0
aload 2
invokevirtual java.lang.String.length:()I
iconst_1
isub
invokevirtual java.lang.String.substring:(II)Ljava/lang/String;
astore 2
31: StackMap locals:
StackMap stack:
aload 2
areturn
end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 32 0 path Ljava/lang/String;
0 32 1 replaceBackSlash Z
3 32 2 normalized Ljava/lang/String;
8 32 3 addedTrailingSlash Z
12 15 4 index I
17 20 4 index I
22 28 4 index I
27 28 5 index2 I
MethodParameters:
Name Flags
path
replaceBackSlash
public static boolean isSameOrigin(jakarta.servlet.http.HttpServletRequest, java.lang.String);
descriptor: (Ljakarta/servlet/http/HttpServletRequest;Ljava/lang/String;)Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=2, locals=6, args_size=2
start local 0 start local 1 0: new java.lang.StringBuilder
dup
invokespecial java.lang.StringBuilder.<init>:()V
astore 2
start local 2 1: aload 0
invokeinterface jakarta.servlet.http.HttpServletRequest.getScheme:()Ljava/lang/String;
astore 3
start local 3 2: aload 3
ifnonnull 4
3: iconst_0
ireturn
4: StackMap locals: java.lang.StringBuilder java.lang.String
StackMap stack:
aload 3
getstatic java.util.Locale.ENGLISH:Ljava/util/Locale;
invokevirtual java.lang.String.toLowerCase:(Ljava/util/Locale;)Ljava/lang/String;
astore 3
5: aload 2
aload 3
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
pop
6: aload 2
ldc "://"
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
pop
7: aload 0
invokeinterface jakarta.servlet.http.HttpServletRequest.getServerName:()Ljava/lang/String;
astore 4
start local 4 8: aload 4
ifnonnull 10
9: iconst_0
ireturn
10: StackMap locals: java.lang.String
StackMap stack:
aload 2
aload 4
invokevirtual java.lang.StringBuilder.append:(Ljava/lang/String;)Ljava/lang/StringBuilder;
pop
11: aload 0
invokeinterface jakarta.servlet.http.HttpServletRequest.getServerPort:()I
istore 5
start local 5 12: aload 2
invokevirtual java.lang.StringBuilder.length:()I
aload 1
invokevirtual java.lang.String.length:()I
if_icmpne 20
13: ldc "http"
aload 3
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 14
ldc "ws"
aload 3
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 15
StackMap locals: int
StackMap stack:
14: iload 5
bipush 80
if_icmpne 17
15: StackMap locals:
StackMap stack:
ldc "https"
aload 3
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifne 16
ldc "wss"
aload 3
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 22
StackMap locals:
StackMap stack:
16: iload 5
sipush 443
if_icmpeq 22
17: StackMap locals:
StackMap stack:
aload 2
bipush 58
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
pop
18: aload 2
iload 5
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
pop
19: goto 22
20: StackMap locals:
StackMap stack:
aload 2
bipush 58
invokevirtual java.lang.StringBuilder.append:(C)Ljava/lang/StringBuilder;
pop
21: aload 2
iload 5
invokevirtual java.lang.StringBuilder.append:(I)Ljava/lang/StringBuilder;
pop
22: StackMap locals:
StackMap stack:
aload 1
aload 2
invokevirtual java.lang.StringBuilder.toString:()Ljava/lang/String;
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ireturn
end local 5 end local 4 end local 3 end local 2 end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 23 0 request Ljakarta/servlet/http/HttpServletRequest;
0 23 1 origin Ljava/lang/String;
1 23 2 target Ljava/lang/StringBuilder;
2 23 3 scheme Ljava/lang/String;
8 23 4 host Ljava/lang/String;
12 23 5 port I
MethodParameters:
Name Flags
request
origin
public static boolean isValidOrigin(java.lang.String);
descriptor: (Ljava/lang/String;)Z
flags: (0x0009) ACC_PUBLIC, ACC_STATIC
Code:
stack=3, locals=2, args_size=1
start local 0 0: aload 0
ldc "%"
invokevirtual java.lang.String.contains:(Ljava/lang/CharSequence;)Z
ifeq 2
1: iconst_0
ireturn
2: StackMap locals:
StackMap stack:
ldc "null"
aload 0
invokevirtual java.lang.String.equals:(Ljava/lang/Object;)Z
ifeq 4
3: iconst_1
ireturn
4: StackMap locals:
StackMap stack:
aload 0
ldc "file://"
invokevirtual java.lang.String.startsWith:(Ljava/lang/String;)Z
ifeq 6
5: iconst_1
ireturn
6: StackMap locals:
StackMap stack:
new java.net.URI
dup
aload 0
invokespecial java.net.URI.<init>:(Ljava/lang/String;)V
astore 1
start local 1 7: goto 10
end local 1 StackMap locals:
StackMap stack: java.net.URISyntaxException
8: pop
9: iconst_0
ireturn
start local 1 10: StackMap locals: java.net.URI
StackMap stack:
aload 1
invokevirtual java.net.URI.getScheme:()Ljava/lang/String;
ifnull 11
iconst_1
ireturn
StackMap locals:
StackMap stack:
11: iconst_0
ireturn
end local 1 end local 0 LocalVariableTable:
Start End Slot Name Signature
0 12 0 origin Ljava/lang/String;
7 8 1 originURI Ljava/net/URI;
10 12 1 originURI Ljava/net/URI;
Exception table:
from to target type
6 7 8 Class java.net.URISyntaxException
MethodParameters:
Name Flags
origin
}
SourceFile: "RequestUtil.java"