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

Temporary handler doesn't remove context #69

Closed
1 task done
Katsute opened this issue Jul 3, 2020 · 1 comment · Fixed by #70
Closed
1 task done

Temporary handler doesn't remove context #69

Katsute opened this issue Jul 3, 2020 · 1 comment · Fixed by #70
Assignees
Labels
bug Something isn't working as expected

Comments

@Katsute
Copy link
Member

Katsute commented Jul 3, 2020

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.01

Issue

Explain your issue. Add any screenshots here
Temporary handler will not remove context from the SimpleHttpServer#getContexts() map, only the HttpServer.
Temporary handler also does not remove itself after time passed until a connection happens.

Expected Behavior

Explain what was supposed to happen
Temporary handler should remove in both instances (may require optional simplehttpserver parameter to handle).
Temporary handler should remove at the time instance.

Steps To Reproduce

Explain how and/or when the error occurred

@Override
public final void handle(final HttpExchange exchange) throws IOException{
if(!hasExpiry || System.currentTimeMillis() < expiry)
handler.handle(exchange);
exchange.getHttpContext().getServer().removeContext(exchange.getHttpContext());
exchange.close();
}

@Katsute Katsute added the bug Something isn't working as expected label Jul 3, 2020
@Katsute Katsute self-assigned this Jul 3, 2020
@Katsute
Copy link
Member Author

Katsute commented Jul 4, 2020

Add an additional check for if #removeContext throws an illegalargexception remove from context map if it happens still contain it

Katsute added a commit that referenced this issue Jul 4, 2020
Katsute added a commit that referenced this issue Jul 4, 2020
Katsute added a commit that referenced this issue Jul 4, 2020
Katsute added a commit that referenced this issue Jul 4, 2020
* NPE (#67)

Co-authored-by: Katsute <[email protected]>

* typo (#68)

Co-authored-by: Katsute <[email protected]>

* Update versioning

* Fix #69 optional, fix remove context issue (#70)

Co-authored-by: Katsute <[email protected]>

* Update SimpleHttpExchangeImpl.java

Co-authored-by: Katsute <[email protected]>
Katsute added a commit that referenced this issue Jul 4, 2020
* server test case

* fix ports

* Fix ports again

* Server tests

* fixes

* Add context tests

* Added exchange methods

* session & cookie test

* handler tests + #stop

* Create PredicateHandlerTests.java

* cleanup & planning

* Update SSEHandlerTests.java

* NPE (#67)

Co-authored-by: Katsute <[email protected]>

* typo (#68)

Co-authored-by: Katsute <[email protected]>

* Update versioning

* Fix #69 optional, fix remove context issue (#70)

Co-authored-by: Katsute <[email protected]>

* Adapt temporary handler tests

* Update ThrottledHandlerTests.java

* Clean up

* Add tests for removal hotfix

* setup

* SSE tests

* Cleanup 🧹

* Delete file.txt

* Added multipart/form-data test

* Merge latest with master (#73)

* NPE (#67)

Co-authored-by: Katsute <[email protected]>

* typo (#68)

Co-authored-by: Katsute <[email protected]>

* Update versioning

* Fix #69 optional, fix remove context issue (#70)

Co-authored-by: Katsute <[email protected]>

* Update SimpleHttpExchangeImpl.java

Co-authored-by: Katsute <[email protected]>

* Add files / adapter tests +UTF8 warning fix

* Add walking tests

* Update FileHandlerTests.java

* File loading option tests 🏁

Co-authored-by: Katsute <[email protected]>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working as expected
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant