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 — Duplicate contexts do not throw IllegalArgumentException [EXTERNAL ISSUE] · Issue #86 · Ktt-Development/simplehttpserver

This repository was archived by the owner on Jul 31, 2022. It is now read-only.
This repository was archived by the owner on Jul 31, 2022. It is now read-only.

Duplicate contexts do not throw IllegalArgumentException [EXTERNAL ISSUE] #86

Copy link
Copy link
Closed
Closed
Duplicate contexts do not throw IllegalArgumentException [EXTERNAL ISSUE]#86
Copy link
Labels
bugSomething isn't working as expectedSomething isn't working as expecteddroppedThis is not being worked onThis is not being worked on

Description

@Katsute
Katsute
opened on Aug 10, 2020
Issue body actions

Prerequisites

If all checks are not passed then the issue will be closed

  • I have checked that no other similar issue already exists

Operating System: Operating system name and version
Windows 10

Release Version: Release version or branch where the issue occurred
03.05.06

Issue

Explain your issue. Add any screenshots here
Duplicate contexts do not throw IllegalArgumentException.
Issue is caused by HttpServer; this is not a SimpleHttpServer issue.

Expected Behavior

Explain what was supposed to happen
Duplicate contexts should throw IllegalArgumentException.

Steps To Reproduce

Explain how and/or when the error occurred
Use createContext on same context using HttpServer.

Activity

  1. Katsute
    added
    bugSomething isn't working as expectedSomething isn't working as expected
    on Aug 10, 2020
  2. Katsute
    added 2 commits that reference this issue on Aug 27, 2020

    Fix #86

    This issue will close once commit 16b5abe is merged into the 'main' branch.
    16b5abe

    Unfixed #86

    This issue will close once commit 226f8c6 is merged into the 'main' branch.
    226f8c6
  3. Katsute commented on Aug 27, 2020

    @Katsute
    Katsute
    on Aug 27, 2020
    MemberAuthor
    More actions

    Multiple tests have been run against the #create method in the sun http server library; but the illargs exception is only thrown for specific contexts, not all. This is a dependency issue and can not be resolved by SimpleHttpServer

  4. Katsute
    added
    droppedThis is not being worked onThis is not being worked on
    on Aug 27, 2020
  5. Katsute
    closed this as completedin 16b5abeon Aug 28, 2020
  6. Katsute
    reopened this on Aug 28, 2020
  7. Katsute
    pinned this issue on Aug 28, 2020
  8. Ktt-Development
    locked as off topic and limited conversation to collaborators on Aug 30, 2020
  9. Katsute
    unpinned this issue on Sep 20, 2020
  10. Katsute commented on Sep 29, 2020

    @Katsute
    Katsute
    on Sep 29, 2020
    MemberAuthor
    More actions

    According to the source code an IllegalArgumentException is never thrown for duplicate contexts. The documentation on this method is invalid.

    sun.net.httpserver.ServerImpl

    ...
        public synchronized HttpContextImpl createContext (String path, HttpHandler handler) {
            if (handler == null || path == null) {
                throw new NullPointerException ("null handler, or path parameter");
            }
            HttpContextImpl context = new HttpContextImpl (protocol, path, handler, this);
            contexts.add (context);
            logger.log (Level.DEBUG, "context created: " + path);
            return context;
        }
    ...

    sun.net.httpserver.HttpContextImpl

    ...
        HttpContextImpl (String protocol, String path, HttpHandler cb, ServerImpl server) {
            if (path == null || protocol == null || path.length() < 1 || path.charAt(0) != '/') {
                throw new IllegalArgumentException ("Illegal value for path or protocol");
            }
            this.protocol = protocol.toLowerCase();
            this.path = path;
            if (!this.protocol.equals ("http") && !this.protocol.equals ("https")) {
                throw new IllegalArgumentException ("Illegal value for protocol");
            }
            this.handler = cb;
            this.server = server;
            authfilter = new AuthFilter(null);
            sfilters.add (authfilter);
        }
    ...
  11. Katsute
    closed this as completedon Sep 29, 2020
  12. Katsute
    pinned this issue on Sep 29, 2020
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

    bugSomething isn't working as expectedSomething isn't working as expecteddroppedThis is not being worked onThis is not being worked on

    Type

    No type

    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.