Skip to content
This repository has been archived by the owner on Aug 3, 2023. It is now read-only.

Commit

Permalink
Added warning for site in unauthenticated preview (#1447)
Browse files Browse the repository at this point in the history
  • Loading branch information
jspspike authored Jul 13, 2020
1 parent b87f31e commit 457790f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/preview/upload.rs
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ fn unauthenticated_upload(target: &Target) -> Result<Preview, failure::Error> {
log::info!("address: {}", create_address);

let mut target = target.clone();
// KV namespaces are not supported by the preview service unless you authenticate
// KV namespaces and sites are not supported by the preview service unless you authenticate
// so we omit them and provide the user with a little guidance. We don't error out, though,
// because there are valid workarounds for this for testing purposes.
if !target.kv_namespaces.is_empty() {
Expand All @@ -189,6 +189,13 @@ fn unauthenticated_upload(target: &Target) -> Result<Preview, failure::Error> {
);
target.kv_namespaces = Vec::new();
}
if target.site.is_some() {
message::warn(
"Sites are not supported in preview without setting API credentials and account_id",
);
target.site = None;
}

let script_upload_form = upload::form::build(&target, None)?;
let client = http::client();
let res = client
Expand Down

0 comments on commit 457790f

Please sign in to comment.