[
https://issues.apache.org/jira/browse/TINKERPOP-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17786952#comment-17786952
]
ASF GitHub Bot commented on TINKERPOP-2830:
-------------------------------------------
Cole-Greer commented on code in PR #2328:
URL: https://github.com/apache/tinkerpop/pull/2328#discussion_r1396392283
##########
gremlin-driver/src/main/java/org/apache/tinkerpop/gremlin/driver/handler/HttpGremlinRequestEncoder.java:
##########
@@ -81,7 +90,9 @@ protected void encode(final ChannelHandlerContext
channelHandlerContext, final R
request.headers().add(HttpHeaderNames.CONTENT_TYPE,
"application/json");
request.headers().add(HttpHeaderNames.CONTENT_LENGTH,
payload.length);
request.headers().add(HttpHeaderNames.ACCEPT,
serializer.mimeTypesSupported()[0]);
-
+ if (userAgentEnabled) {
+ request.headers().add(UserAgent.USER_AGENT_HEADER_NAME,
UserAgent.USER_AGENT);
Review Comment:
As the server header matching is case-insensitive, both of these are
interchangeable with gremlin-server. I would agree that it's best to follow the
HTTP lower-case convention here.
> Handle User-Agent from HTTP Requests to server
> ----------------------------------------------
>
> Key: TINKERPOP-2830
> URL: https://issues.apache.org/jira/browse/TINKERPOP-2830
> Project: TinkerPop
> Issue Type: Improvement
> Components: server
> Affects Versions: 3.5.4
> Reporter: Cole Greer
> Priority: Critical
>
> Changes are being introduced in
> [2480|https://issues.apache.org/jira/browse/TINKERPOP-2480] which add a user
> agent which is sent as a request header during web socket handshakes.
> Originally 2480 was planned to also include the server accepting user agents
> from http requests but this has now fallen outside of the scope. This ticket
> is to complete the user agent feature by adding the ability for the server to
> accept user agents in http requests in addition to web sockets.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)