From 213d6eb78cf2d762fe14c007cd49d4319d48b9e0 Mon Sep 17 00:00:00 2001 From: Randall Coding Date: Thu, 17 Mar 2022 10:00:22 -0600 Subject: [PATCH] Fix basic file upload functionality -> ElementHandle#set_input_files --- src/build.rs | 7 ++++--- src/imp/utils.rs | 6 +++--- 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/build.rs b/src/build.rs index a1a0790..17467c2 100644 --- a/src/build.rs +++ b/src/build.rs @@ -4,7 +4,9 @@ use std::{ path::{Path, PathBuf, MAIN_SEPARATOR} }; -const DRIVER_VERSION: &str = "1.11.0-1620331022000"; +// const DRIVER_VERSION: &str = "1.11.0-1620331022000"; +const DRIVER_VERSION: &str = "1.12.2"; +const NEXT: &str = ""; fn main() { let out_dir: PathBuf = env::var_os("OUT_DIR").unwrap().into(); @@ -79,10 +81,9 @@ fn url(platform: PlaywrightPlatform) -> String { // .contains("next") // .then(|| "/next") // .unwrap_or_default(); - let next = "/next"; format!( "https://playwright.azureedge.net/builds/driver{}/playwright-{}-{}.zip", - next, DRIVER_VERSION, platform + NEXT, DRIVER_VERSION, platform ) } diff --git a/src/imp/utils.rs b/src/imp/utils.rs index 4344e7e..fafd884 100644 --- a/src/imp/utils.rs +++ b/src/imp/utils.rs @@ -228,14 +228,14 @@ pub struct PdfMargins<'a, 'b, 'c, 'd> { #[derive(Debug, Serialize, PartialEq)] pub struct File { pub name: String, - pub mime: String, + pub mimeType: String, pub buffer: String } impl File { - pub fn new(name: String, mime: String, body: &[u8]) -> Self { + pub fn new(name: String, mimeType: String, body: &[u8]) -> Self { let buffer = base64::encode(body); - Self { name, mime, buffer } + Self { name, mimeType, buffer } } } /// Browser distribution channel.