Skip to content

The design language that makes your AI harness better at design.

JavaScript

Merge corpus/stack-4-premise3 into corpus/stack-5-consent

Paul Bakausffb7480d5900
diff --cc crates/browser/src/validity.rs
index 60e82a11b,cebc29bac..85fa74521
--- a/crates/browser/src/validity.rs
+++ b/crates/browser/src/validity.rs
@@@ -278,11 -229,25 +278,27 @@@ impl PageValidity
}
}
+ /// Page- and server-supplied text made safe to print: control characters
+ /// (an escape sequence in a `<title>`, a newline in a header) are written as
+ /// `\u{..}` escapes, so the evidence the CLI prints to a terminal cannot drive
+ /// that terminal.
+ fn printable(s: &str) -> String {
+ let mut out = String::with_capacity(s.len());
+ for c in s.chars() {
+ if c.is_control() {
+ out.extend(c.escape_unicode());
+ } else {
+ out.push(c);
+ }
+ }
+ out
+ }
+
/// Classify a loaded page. `response` is `None` when no main-document
/// response was seen (a `file://` URL, or a same-document navigation).
-pub fn classify(response: Option<&DocumentResponse>, probe: &PageProbe) -> PageValidity {
+/// `consent_wall` turns the consent-wall gate on; a scan that keeps the
+/// banners turns it off.
+pub fn classify_with(response: Option<&DocumentResponse>, probe: &PageProbe, consent_wall: bool) -> PageValidity {
let mut challenge: Vec<String> = Vec::new();
if let Some(r) = response {
if let Some(action) = r.header("x-amzn-waf-action") {
diff --cc crates/detect/src/cli.rs
index b37654add,4a3910b42..1fb5da055
--- a/crates/detect/src/cli.rs
+++ b/crates/detect/src/cli.rs
@@@ -718,13 -721,9 +726,14 @@@ fn scan_targets
),
};
match result {
- Ok(f) => {
+ Ok(scan) => {
+ ctx.note_scanned(&url_options);
- all.extend(f)
+ all.extend(scan.findings);
+ for note in scan.notes {
+ if !ctx.design_notes.contains(&note) {
+ ctx.design_notes.push(note);
+ }
+ }
}
Err(e) => {
ctx.had_operational_failure = true;