-
Notifications
You must be signed in to change notification settings - Fork 536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add Accept
header to 415 responses
#2663
Comments
@komape thank you for reporting this and for proposing to send a PR. The Vert.x 5 release is expected before the end of this year. The sooner the better :-) |
@tsegismont I took a look but unfortunately I cannot execute the I guess this issue is not the right place to ask for help but I'm not sure where else I should ask. I couldn't find anything in the community/user group. I requested to join in order to ask for help. I also couldn't find anything in the commiters group and I cannot ask to join the group. Can you add me? The link to the development group is not working at all anymore. The gitter channel is full with spam and also not usable. I also thought about Stack Overflow but it states at multiple places that the other channels are preferred. Which is the right place to ask for help regarding this issue? I cannot test my added code at the moment which I would like to do before I open a PR. Thanks for your help in advance! Starting test: RouterTest#testConsumes
Unhandled exception
java.lang.NoClassDefFoundError: io/vertx/ext/auth/audit/SecurityAudit
at java.base/java.lang.Class.getDeclaredFields0(Native Method)
at java.base/java.lang.Class.privateGetDeclaredFields(Class.java:3473)
at java.base/java.lang.Class.getDeclaredField(Class.java:2780)
at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:398)
at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl$1.run(AtomicIntegerFieldUpdater.java:396)
at java.base/java.security.AccessController.doPrivileged(AccessController.java:571)
at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater$AtomicIntegerFieldUpdaterImpl.<init>(AtomicIntegerFieldUpdater.java:395)
at java.base/java.util.concurrent.atomic.AtomicIntegerFieldUpdater.newUpdater(AtomicIntegerFieldUpdater.java:93)
at [email protected]/io.vertx.ext.web.impl.RoutingContextImplBase.<clinit>(RoutingContextImplBase.java:43)
at [email protected]/io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:68)
at [email protected]/io.vertx.ext.web.impl.RouterImpl.handle(RouterImpl.java:37)
at [email protected]/io.vertx.core.http.impl.Http1xServerRequestHandler.handle(Http1xServerRequestHandler.java:72)
at [email protected]/io.vertx.core.http.impl.Http1xServerRequestHandler.handle(Http1xServerRequestHandler.java:31)
at [email protected]/io.vertx.core.impl.ContextBase.emit(ContextBase.java:83)
at [email protected]/io.vertx.core.http.impl.Http1xServerConnection.handleMessage(Http1xServerConnection.java:164)
at [email protected]/io.vertx.core.net.impl.VertxConnection.read(VertxConnection.java:240)
at [email protected]/io.vertx.core.net.impl.VertxHandler.channelRead(VertxHandler.java:147)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at [email protected]/io.netty.channel.ChannelInboundHandlerAdapter.channelRead(ChannelInboundHandlerAdapter.java:93)
at [email protected]/io.netty.handler.codec.http.websocketx.extensions.WebSocketServerExtensionHandler.onHttpRequestChannelRead(WebSocketServerExtensionHandler.java:158)
at [email protected]/io.netty.handler.codec.http.websocketx.extensions.WebSocketServerExtensionHandler.channelRead(WebSocketServerExtensionHandler.java:82)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:442)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at [email protected]/io.vertx.core.http.impl.Http1xUpgradeToH2CHandler.channelRead(Http1xUpgradeToH2CHandler.java:120)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at [email protected]/io.netty.handler.codec.ByteToMessageDecoder.fireChannelRead(ByteToMessageDecoder.java:346)
at [email protected]/io.netty.handler.codec.ByteToMessageDecoder.channelRead(ByteToMessageDecoder.java:318)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at [email protected]/io.vertx.core.http.impl.Http1xOrH2CHandler.end(Http1xOrH2CHandler.java:61)
at [email protected]/io.vertx.core.http.impl.Http1xOrH2CHandler.channelRead(Http1xOrH2CHandler.java:38)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:444)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.fireChannelRead(AbstractChannelHandlerContext.java:412)
at [email protected]/io.netty.channel.DefaultChannelPipeline$HeadContext.channelRead(DefaultChannelPipeline.java:1357)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:440)
at [email protected]/io.netty.channel.AbstractChannelHandlerContext.invokeChannelRead(AbstractChannelHandlerContext.java:420)
at [email protected]/io.netty.channel.DefaultChannelPipeline.fireChannelRead(DefaultChannelPipeline.java:868)
at [email protected]/io.netty.channel.nio.AbstractNioByteChannel$NioByteUnsafe.read(AbstractNioByteChannel.java:166)
at [email protected]/io.netty.channel.nio.AbstractNioChannel$AbstractNioUnsafe.handle(AbstractNioChannel.java:444)
at [email protected]/io.netty.channel.nio.NioIoHandler$DefaultNioRegistration.handle(NioIoHandler.java:386)
at [email protected]/io.netty.channel.nio.NioIoHandler.processSelectedKey(NioIoHandler.java:585)
at [email protected]/io.netty.channel.nio.NioIoHandler.processSelectedKeysOptimized(NioIoHandler.java:560)
at [email protected]/io.netty.channel.nio.NioIoHandler.processSelectedKeys(NioIoHandler.java:501)
at [email protected]/io.netty.channel.nio.NioIoHandler.run(NioIoHandler.java:478)
at [email protected]/io.netty.channel.SingleThreadIoEventLoop.runIo(SingleThreadIoEventLoop.java:184)
at [email protected]/io.netty.channel.SingleThreadIoEventLoop.run(SingleThreadIoEventLoop.java:156)
at [email protected]/io.netty.util.concurrent.SingleThreadEventExecutor$5.run(SingleThreadEventExecutor.java:1123)
at [email protected]/io.netty.util.internal.ThreadExecutorMap$2.run(ThreadExecutorMap.java:74)
at [email protected]/io.netty.util.concurrent.FastThreadLocalRunnable.run(FastThreadLocalRunnable.java:30)
at java.base/java.lang.Thread.run(Thread.java:1583)
Caused by: java.lang.ClassNotFoundException: io.vertx.ext.auth.audit.SecurityAudit
at java.base/jdk.internal.loader.BuiltinClassLoader.loadClass(BuiltinClassLoader.java:641)
at java.base/jdk.internal.loader.ClassLoaders$AppClassLoader.loadClass(ClassLoaders.java:188)
at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:526)
... 57 more |
@tsegismont Thanks, see PR #2672 for the draft. |
Accept
header to 415 reponsesAccept
header to 415 responses
Describe the feature
If the content type of a request is not matching the accepted content types, a
415 Unsupported Media Type
status is returned. According to the mdn web docs for the HTTP status 415 and the RFC 9110 for HTTP semantics, anAccept
header with the accepted content types should be returned as well. This is currently missing and should be added.For example, this endpoint accepts JSON and CSV:
In case, the client does not provide any content type or a wrong one, for example
text/plain
, the response should be as follows:HTTP/1.1 415 Unsupported Media Type # other fields Accept: application/json, text/csv Content-Length: 0
This is a follow up from #2656.
Use cases
This feature fulfills the offical semantics for a 415 status.
Additionally, the client gets to know what type of content is accepted without looking for documentation.
Contribution
I would like to do it but I cannot say until when.
When is v5.0.0 supposed to be released?
The text was updated successfully, but these errors were encountered: