Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BitSail] Pref regex pattern #150

Merged
merged 2 commits into from
Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,7 @@
public class SchemaRegistryProvider extends SchemaProvider {

private final TypedProperties config;
private static final Pattern PATTERN = Pattern.compile("://(.*?)@");

public SchemaRegistryProvider(TypedProperties props) {
this.config = props;
Expand All @@ -69,7 +70,7 @@ public SchemaRegistryProvider(TypedProperties props) {
public String fetchSchemaFromRegistry(String registryUrl) throws IOException {
URL registry;
HttpURLConnection connection;
Matcher matcher = Pattern.compile("://(.*?)@").matcher(registryUrl);
Matcher matcher = PATTERN.matcher(registryUrl);
if (matcher.find()) {
String creds = matcher.group(1);
String urlWithoutCreds = registryUrl.replace(creds + "@", "");
Expand Down
2 changes: 1 addition & 1 deletion docs/contributing_zh.md
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ BitSail项目使用了[Google Java Style Guide](https://google.github.io/stylegu
- [Fork ***BitSail*** 代码库](https://docs.github.com/en/get-started/quickstart/fork-a-repo)
- 在你的fork的代码库中生成一个新分支
- 开发你的代码,包括必要的测试用例和编码风格检查
- 提交对分支的更改并推送到你fork的残酷
- 提交对分支的更改并推送到你fork的仓库
- 向 ***BitSail*** 存储库创建pull request

## 请求代码审查
Expand Down