We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c1e1661 commit 782fac0Copy full SHA for 782fac0
rust/src/nasl/builtin/notus/mod.rs
@@ -8,6 +8,7 @@ mod tests;
8
use std::{collections::HashMap, net::SocketAddr};
9
10
use greenbone_scanner_framework::models::FixedVersion;
11
+use http::StatusCode;
12
use nasl_function_proc_macro::nasl_function;
13
use serde::{Deserialize, Serialize};
14
use serde_json;
@@ -76,6 +77,14 @@ impl NaslNotus {
76
77
.await
78
.map_err(|e| HttpError::Custom(e.to_string()))?;
79
80
+ if response.status() != StatusCode::OK {
81
+ return Err(HttpError::Custom(format!(
82
+ "Notus service returned status code {}",
83
+ response.status()
84
+ ))
85
+ .into());
86
+ }
87
+
88
// Parse JSON array of results
89
let results: Vec<NotusResult> = response
90
.json()
0 commit comments