Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8347167

Implementation in com.sun.net.httpserver.Headers.normalize() can be improved

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Unresolved
    • Icon: P4 P4
    • tbd
    • None
    • core-libs
    • None

      The jdk.httpserver module has the com.sun.net.httpserver.Headers class which is meant to represent the HTTP request/response headers. The implementation in this class, stores the header names in an internal Map. The header names are stored as keys in the Map and the implementation in this Headers class normalizes the header names to "First character upper case, rest all characters lower case." (for example: coNtent-leNgth is normalized to Content-Length). Application code can retrieve headers names through this Headers class and while retrieving, the given header name is first normalized before looking for its value in the internal Map. The normalization is handled internally in the Headers.normalize() private method.

      In a net-dev mailing list discussion, it has been proposed that this internal implementation of the normalize() method can be enhanced to improve its performance https://mail.openjdk.org/pipermail/net-dev/2025-January/025315.html.

            Unassigned Unassigned
            jpai Jaikiran Pai
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated: