1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2025-01-03 04:48:52 -05:00

mark Deno.startTls as unstable (#4965)

This commit is contained in:
Bartek Iwańczuk 2020-04-28 18:01:13 +02:00 committed by GitHub
parent 76ee6fb335
commit f7ab19b1b7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -54,10 +54,11 @@ struct StartTLSArgs {
pub fn op_start_tls( pub fn op_start_tls(
isolate: &mut CoreIsolate, isolate: &mut CoreIsolate,
_state: &State, state: &State,
args: Value, args: Value,
_zero_copy: Option<ZeroCopyBuf>, _zero_copy: Option<ZeroCopyBuf>,
) -> Result<JsonOp, OpError> { ) -> Result<JsonOp, OpError> {
state.check_unstable("Deno.startTls");
let args: StartTLSArgs = serde_json::from_value(args)?; let args: StartTLSArgs = serde_json::from_value(args)?;
let rid = args.rid as u32; let rid = args.rid as u32;
let cert_file = args.cert_file.clone(); let cert_file = args.cert_file.clone();
@ -68,6 +69,11 @@ pub fn op_start_tls(
domain.push_str("localhost"); domain.push_str("localhost");
} }
state.check_net(&domain, 0)?;
if let Some(path) = cert_file.clone() {
state.check_read(Path::new(&path))?;
}
let op = async move { let op = async move {
let mut resource_holder = { let mut resource_holder = {
let mut resource_table_ = resource_table.borrow_mut(); let mut resource_table_ = resource_table.borrow_mut();