Sending an invalid accept header results in the following crash, while I assume this should result in a 400 or 415:
<body><h2>HTTP ERROR 500</h2>
<p>Problem accessing /bigdata/ldf. Reason:
<pre> Server Error</pre></p><h3>Caused by:</h3><pre>javax.servlet.ServletException: java.lang.ArrayIndexOutOfBoundsException: 1
at org.linkeddatafragments.servlet.LinkedDataFragmentServlet.doGet(LinkedDataFragmentServlet.java:197)
at org.wikidata.query.rdf.blazegraph.ldf.LDFServlet.doGet(LDFServlet.java:42)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:687)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:790)
at org.eclipse.jetty.servlet.ServletHolder.handle(ServletHolder.java:769)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1667)
at ch.qos.logback.classic.helpers.MDCInsertingServletFilter.doFilter(MDCInsertingServletFilter.java:49)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.wikidata.query.rdf.blazegraph.filters.ClientIPFilter.doFilter(ClientIPFilter.java:43)
at org.eclipse.jetty.servlet.ServletHandler$CachedChain.doFilter(ServletHandler.java:1650)
at org.eclipse.jetty.servlet.ServletHandler.doHandle(ServletHandler.java:583)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:143)
at org.eclipse.jetty.security.SecurityHandler.handle(SecurityHandler.java:577)
at org.eclipse.jetty.server.session.SessionHandler.doHandle(SessionHandler.java:223)
at org.eclipse.jetty.server.handler.ContextHandler.doHandle(ContextHandler.java:1125)
at org.eclipse.jetty.servlet.ServletHandler.doScope(ServletHandler.java:515)
at org.eclipse.jetty.server.session.SessionHandler.doScope(SessionHandler.java:185)
at org.eclipse.jetty.server.handler.ContextHandler.doScope(ContextHandler.java:1059)
at org.eclipse.jetty.server.handler.ScopedHandler.handle(ScopedHandler.java:141)
at org.eclipse.jetty.server.handler.ContextHandlerCollection.handle(ContextHandlerCollection.java:215)
at org.eclipse.jetty.server.handler.HandlerCollection.handle(HandlerCollection.java:110)
at org.eclipse.jetty.server.handler.HandlerWrapper.handle(HandlerWrapper.java:97)
at org.eclipse.jetty.server.Server.handle(Server.java:497)
at org.eclipse.jetty.server.HttpChannel.handle(HttpChannel.java:311)
at org.eclipse.jetty.server.HttpConnection.onFillable(HttpConnection.java:248)
at org.eclipse.jetty.io.AbstractConnection$2.run(AbstractConnection.java:540)
at org.eclipse.jetty.util.thread.QueuedThreadPool.runJob(QueuedThreadPool.java:610)
at org.eclipse.jetty.util.thread.QueuedThreadPool$3.run(QueuedThreadPool.java:539)
at java.lang.Thread.run(Thread.java:748)
Caused by: java.lang.ArrayIndexOutOfBoundsException: 1
at org.linkeddatafragments.util.MIMEParse.parseMimeType(MIMEParse.java:99)
at org.linkeddatafragments.util.MIMEParse.parseMediaRange(MIMEParse.java:119)
at org.linkeddatafragments.util.MIMEParse.bestMatch(MIMEParse.java:268)
at org.linkeddatafragments.util.MIMEParse.bestMatch(MIMEParse.java:292)
at org.linkeddatafragments.servlet.LinkedDataFragmentServlet.doGet(LinkedDataFragmentServlet.java:161)
... 28 more
</pre>
Sending an invalid accept header results in the following crash, while I assume this should result in a 400 or 415:
Source: https://github.com/LinkedDataFragments/Server.Java/blob/master/src/main/java/org/linkeddatafragments/util/MIMEParse.java#L99
This can be reproduced by executing the following:
Note that in this case, the last
,
should actually be;
to be correct.