GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — exception when duplicate header count is greater than 2 · Issue #17 · robaho/httpserver

exception when duplicate header count is greater than 2 #17

New issue
Copy link
New issue
Copy link
Closed
#18
Closed
exception when duplicate header count is greater than 2#17
#18
Copy link

Description

@viretp
viretp
opened on Jan 30, 2025
Issue body actions

This is not possible to add several times the same header name, we get following exception:

2025-01-30 08:56:28.965 WARNING pool-2-thread-1  robaho.net.httpserver.ServerImpl$Exchange run [http:9101] ServerImpl unexpected exception 
java.lang.UnsupportedOperationException
	at java.base/java.util.AbstractList.add(AbstractList.java:155)
	at java.base/java.util.AbstractList.add(AbstractList.java:113)
	at robaho.httpserver/robaho.net.httpserver.OptimizedHeaders.add(OptimizedHeaders.java:97)
	at robaho.httpserver/robaho.net.httpserver.Request.headers(Request.java:202)
	at robaho.httpserver/robaho.net.httpserver.ServerImpl$Exchange.runPerRequest(ServerImpl.java:713)
	at robaho.httpserver/robaho.net.httpserver.ServerImpl$Exchange.run(ServerImpl.java:626)
	at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1144)
	at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:642)
	at java.base/java.lang.Thread.run(Thread.java:1583)

Note that when using the jdk httpserver this problem does not occur.

I have investigated the code and found the problem in method robaho.net.httpserver.OptimizedHeaders.add

I have added a test reproducing the problem and implemented a fix: I will make a pull request with a proposal.

Activity

  1. viretp commented on Jan 30, 2025

    @viretp
    viretp
    on Jan 30, 2025
    ContributorAuthor
    More actions

    Pull request with my proposal: #18

  2. robaho
    changed the title [-]Exception in case duplicate headers are set[/-] [+]exception when duplicate header count is 3 or more[/+] on Jan 30, 2025
  3. robaho
    changed the title [-]exception when duplicate header count is 3 or more[/-] [+]exception when duplicate header count is greater than 2[/+] on Jan 30, 2025
  4. robaho
    added a commit that references this issue on Jan 30, 2025

    fix issue #17 - duplicate header count more than 2 causes exception (#18

    2a13b2a
  5. robaho
    closed this as completedin #18on Jan 30, 2025
  6. robaho commented on Jan 30, 2025

    @robaho
    robaho
    on Jan 30, 2025
    Owner
    More actions

    resolved in 1.0.22

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions

      You are visitor 01402503 — GeezerVison does not store the pages you look up.
      Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.