Skip to content

Commit 17d7796

Browse files
committed
Merge branch 'whitelist-extensions'
2 parents fd5d84f + 920f846 commit 17d7796

File tree

5 files changed

+14
-4
lines changed

5 files changed

+14
-4
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
# Changelog
22

3+
## 1.4.0
4+
5+
- Whitelist Chrome and Firefox extensions
6+
37
## 1.3.1
48

59
- Fix a bug where the bridge crashes if a connected USB devices contains unicode in the HID device info

Cargo.lock

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

bitbox-bridge/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "bitbox-bridge"
3-
version = "1.3.1"
3+
version = "1.4.0"
44
authors = ["Niklas Claesson <[email protected]>"]
55
edition = "2018"
66
license = "Apache-2.0"

bitbox-bridge/release/windows/wix/Product.wxs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
33

44
<!-- ProductCode should change with every release -->
5-
<?define ProductCode = "{f75f2097-6bad-4bd5-b6d7-352c048df6ae}"?>
5+
<?define ProductCode = "{ddf4b648-48b7-4855-9945-6e9e81c4951b}"?>
66
<!-- UpgradeCode should stay the same foverever (this is the real ID of the app)-->
77
<?define UpgradeCode = "{dfe7eecb-5dc0-4c30-ba78-a9eff36efa31}"?>
88

bitbox-bridge/src/web.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -200,9 +200,15 @@ pub fn create(
200200
// Use untuple_one at the end to get rid of the "unit" return value
201201
let check_origin = warp::header::optional("origin")
202202
.and_then(|origin: Option<hyper::Uri>| {
203-
debug!("{:?}", origin);
203+
debug!("Origin: {:?}", origin);
204204
async move {
205205
if let Some(origin) = origin {
206+
let scheme_str = origin.scheme_str();
207+
if scheme_str == Some("chrome-extension") || scheme_str == Some("moz-extension")
208+
{
209+
debug!("Allow Chrome/Firefox extension");
210+
return Ok(());
211+
}
206212
match origin.host() {
207213
Some(host) => {
208214
if !is_valid_origin(host) {

0 commit comments

Comments
 (0)