Ktt-Development/simplehttpserver

Http Server Backwards Compatibility

Katsute opened this issue · 5 comments

Prerequisites

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

  • I have checked that no other similar feature request already exists
  • The feature request makes sense for the project

Proposal

Describe the feature that should be added
Allow the setting of a http session handler (similar to the current set executor method) which acts like a handler and asks for the cookie name in the constructor.

Reasoning

Explain why this feature should be added
This would make the http session more flexible.

Use cookies from #31

Utilize #lastAccessTime

rewrite how server handles handlers --> have the server encapsulate every handler but link them so calling the inner one allows the deleting of the outer one.

TODO:

  • Adjust #createContext method to add authenticator as a parameter. https://docs.oracle.com/javase/8/docs/jre/api/net/httpserver/spec/com/sun/net/httpserver/HttpContext.html
  • Remove simple authenticator and convert simple http handler to interface
  • Change how server handles handlers →
    • Create context creates contexts with wrapped handlers
    • Server has wrapped handlers while get context returns the handlers the server is wrapping
    • This will allow server pre-execution
  • Add Http Session method to server, similar to set executor
  • Add illegalargs on any duplicate contexts

Added to master