featzhang commented on code in PR #32:
URL: 
https://github.com/apache/flink-connector-http/pull/32#discussion_r3026825347


##########
flink-connector-http/src/main/java/org/apache/flink/connector/http/table/lookup/HttpLookupConnectorOptions.java:
##########
@@ -227,4 +229,24 @@ public class HttpLookupConnectorOptions {
                                     + "Ignored responses togater with `"
                                     + SOURCE_RETRY_SUCCESS_CODES
                                     + "` are considered as successful.");
+
+    /**
+     * Custom HTTP headers for lookup requests.
+     *
+     * <p>Headers are specified as key-value pairs using the prefix {@code
+     * http.source.lookup.header.}, for example:
+     *
+     * <pre>{@code
+     * 'http.source.lookup.header.Content-Type' = 'application/json',
+     * 'http.source.lookup.header.Authorization' = 'Bearer my-token'
+     * }</pre>
+     */
+    public static final ConfigOption<Map<String, String>> 
SOURCE_LOOKUP_HEADERS =

Review Comment:
   Thanks @davidradl, you're right that custom headers are already functionally 
supported via the http.source.lookup.header. and http.sink.header. property 
prefixes.
   
   This PR does not change the runtime behavior at all — headers are still read 
by the existing HttpHeaderUtils.prepareHeaderMap() mechanism. The goal here is 
to formalize these existing properties as official ConfigOption declarations. 
Without this change, there are a few practical issues:
   
   Validation errors: When users specify headers like 
'http.source.lookup.header.Content-Type' = 'application/json' in SQL DDL, 
Flink's table option validator throws a ValidationException because these keys 
are not registered as recognized options in optionalOptions().
   
   Discoverability: Formal ConfigOption definitions enable IDE autocomplete and 
appear in generated documentation, making it easier for users to find and use 
these settings.
   
   Consistency: Other Flink connectors (e.g., Kafka, JDBC) declare all their 
configuration as ConfigOption — this aligns the HTTP connector with that 
standard practice.
   
   In short, this is about promoting existing "hidden" configuration to 
first-class ConfigOption status for better validation, documentation, and user 
experience.



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

Reply via email to