No-ui compilation feature
This commit is contained in:
@@ -51,6 +51,7 @@ extern crate ethcore_util as util;
|
||||
extern crate ethcore_rpc as rpc;
|
||||
extern crate jsonrpc_core;
|
||||
extern crate ws;
|
||||
#[cfg(not(feature = "no-ui"))]
|
||||
extern crate parity_dapps_signer as signer;
|
||||
|
||||
mod authcode_store;
|
||||
|
||||
@@ -17,7 +17,6 @@
|
||||
//! Session handlers factory.
|
||||
|
||||
use ws;
|
||||
use signer;
|
||||
use authcode_store::AuthCodes;
|
||||
use std::path::{PathBuf, Path};
|
||||
use std::sync::Arc;
|
||||
@@ -25,6 +24,26 @@ use std::str::FromStr;
|
||||
use jsonrpc_core::IoHandler;
|
||||
use util::H256;
|
||||
|
||||
#[cfg(not(feature = "no-ui"))]
|
||||
mod signer {
|
||||
use signer;
|
||||
|
||||
pub fn handle(req: &str) -> Option<signer::File> {
|
||||
signer::handle(req)
|
||||
}
|
||||
}
|
||||
#[cfg(feature = "no-ui")]
|
||||
mod signer {
|
||||
pub struct File {
|
||||
pub content: String,
|
||||
pub mime: String,
|
||||
}
|
||||
|
||||
pub fn handle(_req: &str) -> Option<File> {
|
||||
None
|
||||
}
|
||||
}
|
||||
|
||||
fn origin_is_allowed(self_origin: &str, header: Option<&[u8]>) -> bool {
|
||||
match header {
|
||||
None => false,
|
||||
|
||||
Reference in New Issue
Block a user