tisonkun commented on code in PR #20824:
URL: https://github.com/apache/pulsar/pull/20824#discussion_r1284966670


##########
pulsar-client/src/main/java/org/apache/pulsar/client/impl/auth/oauth2/ClientCredentialsFlow.java:
##########
@@ -137,19 +138,18 @@ public static ClientCredentialsFlow 
fromParameters(Map<String, String> params) {
      * @return
      * @throws IOException
      */
-    private static KeyFile loadPrivateKey(String privateKeyURL) throws 
IOException {
+    @VisibleForTesting
+    static KeyFile loadPrivateKey(String privateKeyURL) throws IOException {
         try {
             URLConnection urlConnection = new 
org.apache.pulsar.client.api.url.URL(privateKeyURL).openConnection();
             try {
                 String protocol = urlConnection.getURL().getProtocol();
-                String contentType = urlConnection.getContentType();
-                if ("data".equals(protocol) && 
!"application/json".equals(contentType)) {
+                if ("data".equals(protocol) && 
!"application/json".equals(urlConnection.getContentType())) {

Review Comment:
   > URL content type is only required if the scheme is data
   
   But we already only verify the `contentType` if the protocol is "data"?
   
   I don't see the different for this point before and after this patch.



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