mirror of
https://github.com/LemmyNet/activitypub-federation-rust.git
synced 2024-06-02 13:29:36 +00:00
Merge branch 'main' into disable_retry_queue
This commit is contained in:
commit
fe7b6cffa7
|
@ -74,6 +74,9 @@ pub struct FederationConfig<T: Clone> {
|
|||
/// more consistent. Do not use for production.
|
||||
#[builder(default = "false")]
|
||||
pub(crate) debug: bool,
|
||||
/// Allow HTTP urls even in production mode
|
||||
#[builder(default = "self.debug.unwrap_or(false)")]
|
||||
pub(crate) allow_http_urls: bool,
|
||||
/// Timeout for all HTTP requests. HTTP signatures are valid for 10s, so it makes sense to
|
||||
/// use the same as timeout when sending
|
||||
#[builder(default = "Duration::from_secs(10)")]
|
||||
|
@ -138,7 +141,7 @@ impl<T: Clone> FederationConfig<T> {
|
|||
match url.scheme() {
|
||||
"https" => {}
|
||||
"http" => {
|
||||
if !self.debug {
|
||||
if !self.allow_http_urls {
|
||||
return Err(Error::UrlVerificationError(
|
||||
"Http urls are only allowed in debug mode",
|
||||
));
|
||||
|
|
Loading…
Reference in a new issue