-
-
Notifications
You must be signed in to change notification settings - Fork 534
Open
Labels
bugSomething isn't workingSomething isn't working
Description
What happened?
stalwart-cli fails on JMAP-related actions with Aborting redirect request to unknown host when trying to use an URL that contains a non-standard port, such as http://localhost:8080.
Why is this happening (my humble research)
Consider the following function:
stalwart/crates/cli/src/modules/mod.rs
Line 239 in b39b4ec
| pub fn host(url: &str) -> Option<&str> { |
The function is being called in the setup code of the JMAP client:
stalwart/crates/cli/src/main.rs
Line 199 in b39b4ec
| .follow_redirects([host(&self.url).expect("Invalid host").to_owned()]) |
Because of the nature of comparison that happens within the JMAP client, this always results in an error (jumps to the else condition of the comparison within stalwart-cli's code):
How can we reproduce the problem?
- Set up an HTTP listener with a non-default port, i.e. HTTP on
localhost:8080. Try to pass it tostalwart-clias URL argument. stalwart-cli will fail to work. - Move the HTTP listener to port
80and omit the port in the URL entirely: Then the CLI will work.
Version
v0.13.x
What database are you using?
RocksDB
What blob storage are you using?
Filesystem
Where is your directory located?
Internal
What operating system are you using?
Linux
Relevant log output
Code of Conduct
- I agree to follow this project's Code of Conduct
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working