davidradl commented on code in PR #34: URL: https://github.com/apache/flink-connector-http/pull/34#discussion_r3187842422
########## docs/content.zh/docs/connectors/table/http.md: ########## @@ -448,6 +450,32 @@ CREATE TABLE http-lookup ( Note that when using OIDC, it adds an `Authentication` header with the bearer token; this will override an existing `Authorization` header specified in configuration. +### User-Agent + +The `User-Agent` header value can be configured via the dedicated `http.user.agent` option. When not +specified, the connector sends every request with `User-Agent: flink-connector-http`. This makes the +connector identifiable to the target server out of the box and is useful for server-side logging, +rate limiting and access auditing. + +```roomsql +CREATE TABLE Customers ( + id INT, + name STRING, + email STRING +) WITH ( + 'connector' = 'http', + 'url' = 'http://api.example.com/customers', + 'format' = 'json', + 'http.user.agent' = 'MyApp/1.0' +) +``` + +The same option is also available for the HTTP sink, see the [Sink Connector Options](#sink-connector-options) table. + +Setting `User-Agent` through both `http.user.agent` and `http.source.lookup.header.User-Agent` +(or `http.sink.header.User-Agent` for the sink) is ambiguous and is rejected at table creation time +with an `IllegalArgumentException`. Configure it through exactly one of the two options. Review Comment: nit: remove the word exactly -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected]
