[ 
https://issues.apache.org/jira/browse/TINKERPOP-2830?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17776923#comment-17776923
 ] 

Cole Greer commented on TINKERPOP-2830:
---------------------------------------

Based on the work which has gone on in 
[TINKERPOP-2982|https://issues.apache.org/jira/browse/TINKERPOP-2982] and 
[TINKERPOP-3006|https://issues.apache.org/jira/browse/TINKERPOP-3006], I 
believe the scope of this ticket should be expanded to include sending the 
default user agent from Websockets in HTTP requests from Java and Python.

There are a couple of issues which need to be resolved with this JIRA:

1. Currently the server only handles user agent headers found during the web 
socket handshake. Additional handling will be needed per HTTP request.

2. There are essentially 2 separate user agent mechanisms in TinkerPop 
currently. GLV's all send a default user agent in a "User-Agent" header in the 
websocket handshake, while there is a separate mechanism where clients can 
submit a "userAgent" header on a per-request basis 
(https://tinkerpop.apache.org/docs/3.7.0/reference/#_per_request_settings) 
although there is currently no server handling for such a header.

The per-request "userAgent" is quite in line with the requirements for a HTTP 
user agent. My suggestion is that for HTTP connections, we assign the default 
"[Application Name] [GLV Name].[Version] [Language Runtime Version] 
[OS].[Version] [CPU Architecture]" user agent from websockets to the 
"userAgent" header. Users should still be able to override this header through 
the per-request settings, and the default assignment should be disabled with 
the same "enableUserAgentOnConnect" settings (perhaps a rename is required). 
The existing server handling for websockets should be adapted for use with the 
"userAgent" header in HTTP requests.

We should additionally create a plan to standardize on a single header name for 
user agents, perhaps by migrating websockets to the "userAgent" header and 
deprecating the use of "User-Agent".

> 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)

Reply via email to