You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@pulsar.apache.org by "tisonkun (via GitHub)" <gi...@apache.org> on 2023/08/05 04:48:59 UTC
[GitHub] [pulsar] tisonkun commented on a diff in pull request #20824: [fix][client] Oauth2 client credentials flow accepts private keys without content type
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: commits-unsubscribe@pulsar.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org