smengcl opened a new pull request, #11854: URL: https://github.com/apache/ozone/pull/11854
Generated-by: Claude Code (Opus 5.5) ## What changes were proposed in this pull request? When `ozone.s3g.domain.name` is set and the Host header (port stripped) matches none of the configured domains, `VirtualHostStyleFilter` throws `org.apache.hadoop.fs.InvalidRequestException`. It is not an `OS3Exception`, so the client gets HTTP 500 with no S3 error body. The same applies to a virtual host style Host with no dot before the domain. AWS SDKs and S3A retry 500s, so a configuration mistake shows up as a slow failure that looks like a hang. For example, if the gateway's own FQDN is missing from the domain list, every path style request to it (including a health probe `HEAD /`) fails with 500. This patch keeps rejecting those requests but returns an S3 `400 InvalidRequest` naming the rejected host, using `S3ErrorTable` and `wrapOS3Exception` the same way `AuthorizationFilter` does, so clients fail fast with a clear error. The configured domain list and the request URI are logged at debug level instead of being returned, since the client is not authenticated at this point. Treating an unmatched Host as path style was considered instead, but then a virtual host style request sent to an unlisted host name would be read as a different operation (for example `DELETE bucket.host/key` would become DeleteBucket `key`). ## What is the link to the Apache JIRA https://issues.apache.org/jira/browse/HDDS-17571 ## How was this patch tested? Extended `TestVirtualHostStyleFilter`: the existing rejection cases (including the IPv6 ones) now assert a 400 `InvalidRequest`, and a new case covers a path style request whose Host is missing from the domain list. 🤖 Generated with [Claude Code](https://claude.com/claude-code) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
