Submitting a token-less request to any path requiring a token will cause an error in the server.
Steps to reproduce this issue
Assuming the database is setup according to the README and web server is running:
Without executing any request, issue any request to a path requiring a token, but do not provide the token in the request (e.g. http://localhost:8081/BookManagementService/books).
What's the expected result?
The API returns 400 Bad Request
What's the actual result?
The client receives no response
curl -v -X GET http://localhost:8081/BookManagementService/books
Note: Unnecessary use of -X or --request, GET is already inferred.
* Trying ::1:8081...
* Connected to localhost (::1) port 8081 (#0)
> GET /BookManagementService/books HTTP/1.1
> Host: localhost:8081
> User-Agent: curl/7.70.0
> Accept: */*
>
* Empty reply from server
* Connection #0 to host localhost left intact
curl: (52) Empty reply from server
The server throws a ArrayIndexOutOfBoundsException
java.lang.ArrayIndexOutOfBoundsException: Index 1 out of bounds for length 1
at LibraryManagementService_Async.Utils.URIparser.getQueryParams(URIparser.java:62)
at LibraryManagementService_Async.Utils.URIparser.getToken(URIparser.java:74)
at LibraryManagementService_Async.Operations.BookManagement.lookBooks(BookManagement.java:99)
at LibraryManagementService_Async.Handlers.POSTHandler.handleInternal(POSTHandler.java:66)
at LibraryManagementService_Async.Handlers.Handler.handle(Handler.java:35)
at LibraryManagementService_Async.Handlers.Handler.handle(Handler.java:13)
at org.apache.http.nio.protocol.HttpAsyncService.responseReady(HttpAsyncService.java:480)
at org.apache.http.impl.nio.DefaultNHttpServerConnection.produceOutput(DefaultNHttpServerConnection.java:306)
at org.apache.http.impl.nio.DefaultHttpServerIODispatch.onOutputReady(DefaultHttpServerIODispatch.java:248)
at org.apache.http.impl.nio.DefaultHttpServerIODispatch.onOutputReady(DefaultHttpServerIODispatch.java:57)
at org.apache.http.impl.nio.reactor.AbstractIODispatch.outputReady(AbstractIODispatch.java:145)
at org.apache.http.impl.nio.reactor.BaseIOReactor.writable(BaseIOReactor.java:187)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvent(AbstractIOReactor.java:341)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.processEvents(AbstractIOReactor.java:315)
at org.apache.http.impl.nio.reactor.AbstractIOReactor.execute(AbstractIOReactor.java:276)
at org.apache.http.impl.nio.reactor.BaseIOReactor.execute(BaseIOReactor.java:104)
at org.apache.http.impl.nio.reactor.AbstractMultiworkerIOReactor$Worker.run(AbstractMultiworkerIOReactor.java:591)
at java.base/java.lang.Thread.run(Thread.java:834)
Which part of the spec does this violate?
None, although the following marking scheme point may be of relevance:
The system cannot crash under any testing request.
Issue description
Submitting a token-less request to any path requiring a token will cause an error in the server.
Steps to reproduce this issue
Assuming the database is setup according to the README and web server is running:
http://localhost:8081/BookManagementService/books
).What's the expected result?
400 Bad Request
What's the actual result?
ArrayIndexOutOfBoundsException
Which part of the spec does this violate?
None, although the following marking scheme point may be of relevance: