Make the /resolve_magnet HTTP endpoint return an actual torrent file, not info
This commit is contained in:
parent
cd0f38f0fb
commit
d54b67d2dc
6 changed files with 132 additions and 23 deletions
|
|
@ -328,12 +328,18 @@ impl<'ser, W: std::io::Write> Serializer for &'ser mut BencodeSerializer<W> {
|
|||
|
||||
fn serialize_newtype_struct<T>(
|
||||
self,
|
||||
_name: &'static str,
|
||||
_value: &T,
|
||||
name: &'static str,
|
||||
value: &T,
|
||||
) -> Result<Self::Ok, Self::Error>
|
||||
where
|
||||
T: ?Sized + serde::Serialize,
|
||||
{
|
||||
if name == crate::raw_value::TAG {
|
||||
self.hack_no_bytestring_prefix = true;
|
||||
value.serialize(&mut *self)?;
|
||||
self.hack_no_bytestring_prefix = false;
|
||||
return Ok(());
|
||||
}
|
||||
Err(SerError::custom_with_ser(
|
||||
"bencode doesn't support newtype structs",
|
||||
self,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue