From c49f9e4dd3ef590714a086d6079e73a6e7e2e449 Mon Sep 17 00:00:00 2001 From: Quaternions Date: Fri, 13 Dec 2024 19:01:37 -0800 Subject: [PATCH] cookie: prepend in library --- rbx_asset/src/cookie.rs | 3 ++- src/main.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/rbx_asset/src/cookie.rs b/rbx_asset/src/cookie.rs index 372f35b..4dbf9e7 100644 --- a/rbx_asset/src/cookie.rs +++ b/rbx_asset/src/cookie.rs @@ -199,8 +199,9 @@ fn read_readable(mut readable:impl std::io::Read)->std::io::Result>{ #[derive(Clone)] pub struct Cookie(String); impl Cookie{ + /// cookie is prepended with ".ROBLOSECURITY=" by this function pub fn new(cookie:String)->Self{ - Self(cookie) + Self(format!(".ROBLOSECURITY={cookie}")) } pub fn get(self)->String{ self.0 diff --git a/src/main.rs b/src/main.rs index 133e8e0..2bea961 100644 --- a/src/main.rs +++ b/src/main.rs @@ -621,7 +621,7 @@ async fn cookie_from_args(literal:Option,environment:Option,file (None,None,Some(cookie_file))=>tokio::fs::read_to_string(cookie_file).await?, _=>Err(anyhow::Error::msg("Illegal cookie argument triple"))?, }; - Ok(Cookie::new(format!(".ROBLOSECURITY={cookie}"))) + Ok(Cookie::new(cookie)) } async fn api_key_from_args(literal:Option,environment:Option,file:Option)->AResult{ let api_key=match (literal,environment,file){