clbarnes opened a new issue, #7242:
URL: https://github.com/apache/opendal/issues/7242
### Describe the bug
When testing #7241 I found that `Operator::from_uri` would not recognise the
`http` (or `https`) scheme unless it was explicitly registered, where my
understanding was that it should be registered automatically when the
`services-http` feature is active.
This could be the case for other operators. I also recommend adding a method
to the registry to retrieve which schemes are registered.
```rust
impl OperatorRegistry {
...
pub fn schemes(&self) -> Vec<String> {
let guard = self
.factories
.lock()
.expect("operator registry mutex poisoned");
guard.keys().cloned().collect()
}
}
```
### Steps to Reproduce
```rust
let uri = "http://example.com";
let should_pass_but_fails = opendal::Operator::from_uri(uri);
assert!(should_pass_but_fails.is_err())
opendal::DEFAULT_OPERATOR_REGISTRY.register::<opendal::services::Http>("http");
let now_passes = opendal::Operator::from_uri(uri);
assert!(now_passes.is_ok());
```
### Expected Behavior
Should be able to recognise the http scheme.
### Additional Context
_No response_
### Are you willing to submit a PR to fix this bug?
- [ ] Yes, I would like to submit a PR.
--
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]