Skip to content

Conversation

@shantyk
Copy link

@shantyk shantyk commented Oct 29, 2025

JIRA Ticket
IDETECT-4897

Description
Fixed case-sensitivity issue in startMultipartUpload() method in FileUploader class where the Location header lookup was failing when proxies (e.g.mitmproxy) returned lowercase header names.

  • Modified startMultipartUpload() method to use TreeMap<>(String.CASE_INSENSITIVE_ORDER) for header retrieval, ensuring case-insensitive key matching while preserving case-sensitive values
  • Added FileUploaderHeaderTest class which covers the following:
    • Successful header retrieval with lowercase headers (real-world proxy scenario using mitmproxy)
    • Missing Location header error handling
    • HTTP error response handling (500 status code)

@shantyk shantyk self-assigned this Oct 29, 2025
Map<String, String> caseInsensitiveResponseHeaders = new TreeMap<>(String.CASE_INSENSITIVE_ORDER);
caseInsensitiveResponseHeaders.putAll(responseHeaders);

return Optional.ofNullable(caseInsensitiveResponseHeaders.get(HttpHeaders.LOCATION)).orElseThrow(() -> new IntegrationException("Could not find Location header."));
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This ensures the keys are case insensitive but the values are still case sensitive. (A test should be added)

@shantyk shantyk changed the title fix (multipart upload): Update FileUploader class to handle location header with no case sensitivity. DRAFT fix (multipart upload): Update FileUploader class to handle location header with no case sensitivity. Oct 29, 2025
@zahidblackduck zahidblackduck self-assigned this Nov 18, 2025
@zahidblackduck zahidblackduck changed the title DRAFT fix (multipart upload): Update FileUploader class to handle location header with no case sensitivity. fix: Handle case-insensitive headers in multipart binary upload endpoint Nov 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants