Fix regression with opaque URI determination

Before RfcUriParser we expected opaque URI's to not have ":/"
after the scheme while the new parser expect opaque URI's to
not have a slash anywhere after the scheme. This commit
restores the previous behavior.

Closes gh-34588
This commit is contained in:
rstoyanchev
2025-03-21 09:05:31 +00:00
parent 5455c645f0
commit 15c20c3e65
2 changed files with 16 additions and 4 deletions

View File

@@ -1,5 +1,5 @@
/*
* Copyright 2002-2024 the original author or authors.
* Copyright 2002-2025 the original author or authors.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
@@ -503,8 +503,7 @@ abstract class RfcUriParser {
// Component capture
public InternalParser resolveIfOpaque() {
boolean hasSlash = (this.uri.indexOf('/', this.index + 1) == -1);
this.isOpaque = (hasSlash && !hierarchicalSchemes.contains(this.scheme));
this.isOpaque = (this.uri.charAt(this.index) != '/' && !hierarchicalSchemes.contains(this.scheme));
return this;
}