Skip to content

Commit 03edd5f

Browse files
authored
tauri cors fix (#1344)
1 parent 0ef57ff commit 03edd5f

6 files changed

Lines changed: 116 additions & 9 deletions

File tree

crates/desktop/artcraft/src/core/commands/enqueue/image_edit/artcraft/handle_image_edit_artcraft_via_router.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -72,6 +72,7 @@ pub(super) async fn handle_image_edit_artcraft_via_router(
7272
image_inputs,
7373
resolution,
7474
aspect_ratio,
75+
quality: None, // TODO(bt): Add quality
7576
image_batch_count: request.image_count.map(|n| n as u16),
7677
request_mismatch_mitigation_strategy: RequestMismatchMitigationStrategy::PayMoreUpgrade,
7778
generation_mode_mismatch_strategy: None,

crates/desktop/artcraft/src/core/commands/enqueue/text_to_image/artcraft/handle_text_to_image_artcraft_via_router.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ pub(super) async fn handle_text_to_image_artcraft_via_router(
5050
image_inputs,
5151
resolution,
5252
aspect_ratio,
53+
quality: None, // TODO: Add quality
5354
image_batch_count: request.number_images.map(|n| n as u16),
5455
request_mismatch_mitigation_strategy: RequestMismatchMitigationStrategy::PayMoreUpgrade,
5556
generation_mode_mismatch_strategy: None,

crates/desktop/artcraft/tauri-dev-hot-reload.conf.json

Lines changed: 83 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,88 @@
88
"app": {
99
"withGlobalTauri": true,
1010
"windows": [
11-
]
11+
],
12+
"security": {
13+
"assetProtocol": {
14+
"enable": true,
15+
"scope": ["**"]
16+
},
17+
"csp": {
18+
"default-src": [
19+
"'self'",
20+
"'unsafe-eval'",
21+
"'unsafe-inline'",
22+
"blob:",
23+
"data:",
24+
"https://*.fakeyou.com",
25+
"https://*.storyteller.ai",
26+
"https://www.google-analytics.com",
27+
"https://www.googletagmanager.com",
28+
"ipc://localhost",
29+
"tauri://localhost"
30+
],
31+
"connect-src": [
32+
"'self'",
33+
"'unsafe-eval'",
34+
"'unsafe-inline'",
35+
"asset:",
36+
"blob:",
37+
"data:",
38+
"http://ipc.localhost",
39+
"https://*.clarity.ms",
40+
"https://*.fakeyou.com",
41+
"https://*.storyteller.ai",
42+
"https://asset.localhost",
43+
"https://unpkg.com/detect-gpu@5.0.70/",
44+
"https://www.google-analytics.com",
45+
"https://www.googletagmanager.com",
46+
"ipc://localhost",
47+
"tauri://localhost"
48+
],
49+
"font-src": "*",
50+
"img-src": [
51+
"",
52+
"'self'",
53+
"'unsafe-inline'",
54+
"*",
55+
"blob:",
56+
"data:",
57+
"https://*.fakeyou.com",
58+
"https://*.storyteller.ai",
59+
"ipc://localhost",
60+
"tauri://localhost"
61+
],
62+
"script-src": [
63+
"'self'",
64+
"'unsafe-eval'",
65+
"'unsafe-inline'",
66+
"'wasm-unsafe-eval'",
67+
"asset:",
68+
"blob:",
69+
"data:",
70+
"https://*.clarity.ms",
71+
"https://*.fakeyou.com",
72+
"https://*.storyteller.ai",
73+
"https://*.unpkg.com",
74+
"https://clarity.ms",
75+
"https://unpkg.com",
76+
"ipc://localhost",
77+
"tauri:",
78+
"tauri://localhost"
79+
],
80+
"style-src": [
81+
"'self'",
82+
"'unsafe-eval'",
83+
"'unsafe-inline'",
84+
"blob:",
85+
"data:",
86+
"https://*.fakeyou.com",
87+
"https://*.storyteller.ai",
88+
"https://fonts.googleapis.com",
89+
"ipc://localhost",
90+
"tauri://localhost"
91+
]
92+
}
93+
}
1294
}
1395
}

crates/desktop/artcraft/tauri-mac.conf.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,21 +37,32 @@
3737
"'unsafe-eval'",
3838
"'unsafe-inline'",
3939
"asset:",
40-
"https://asset.localhost",
4140
"blob:",
4241
"data:",
4342
"http://ipc.localhost",
43+
"https://*.clarity.ms",
4444
"https://*.fakeyou.com",
4545
"https://*.storyteller.ai",
46-
"https://*.clarity.ms",
46+
"https://asset.localhost",
4747
"https://unpkg.com/detect-gpu@5.0.70/",
4848
"https://www.google-analytics.com",
4949
"https://www.googletagmanager.com",
5050
"ipc://localhost",
5151
"tauri://localhost"
5252
],
5353
"font-src": "*",
54-
"img-src": "* data: blob: 'unsafe-inline'",
54+
"img-src": [
55+
"",
56+
"'self'",
57+
"'unsafe-inline'",
58+
"*",
59+
"blob:",
60+
"data:",
61+
"https://*.fakeyou.com",
62+
"https://*.storyteller.ai",
63+
"ipc://localhost",
64+
"tauri://localhost"
65+
],
5566
"script-src": [
5667
"'self'",
5768
"'unsafe-eval'",
@@ -60,14 +71,14 @@
6071
"asset:",
6172
"blob:",
6273
"data:",
63-
"tauri:",
6474
"https://*.clarity.ms",
6575
"https://*.fakeyou.com",
6676
"https://*.storyteller.ai",
6777
"https://*.unpkg.com",
6878
"https://clarity.ms",
6979
"https://unpkg.com",
7080
"ipc://localhost",
81+
"tauri:",
7182
"tauri://localhost"
7283
],
7384
"style-src": [

crates/desktop/artcraft/tauri.conf.json

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,21 +36,32 @@
3636
"'unsafe-eval'",
3737
"'unsafe-inline'",
3838
"asset:",
39-
"https://asset.localhost",
4039
"blob:",
4140
"data:",
4241
"http://ipc.localhost",
42+
"https://*.clarity.ms",
4343
"https://*.fakeyou.com",
4444
"https://*.storyteller.ai",
45-
"https://*.clarity.ms",
45+
"https://asset.localhost",
4646
"https://unpkg.com/detect-gpu@5.0.70/",
4747
"https://www.google-analytics.com",
4848
"https://www.googletagmanager.com",
4949
"ipc://localhost",
5050
"tauri://localhost"
5151
],
5252
"font-src": "*",
53-
"img-src": "* data: blob: 'unsafe-inline'",
53+
"img-src": [
54+
"",
55+
"'self'",
56+
"'unsafe-inline'",
57+
"*",
58+
"blob:",
59+
"data:",
60+
"https://*.fakeyou.com",
61+
"https://*.storyteller.ai",
62+
"ipc://localhost",
63+
"tauri://localhost"
64+
],
5465
"script-src": [
5566
"'self'",
5667
"'unsafe-eval'",
@@ -59,14 +70,14 @@
5970
"asset:",
6071
"blob:",
6172
"data:",
62-
"tauri:",
6373
"https://*.clarity.ms",
6474
"https://*.fakeyou.com",
6575
"https://*.storyteller.ai",
6676
"https://*.unpkg.com",
6777
"https://clarity.ms",
6878
"https://unpkg.com",
6979
"ipc://localhost",
80+
"tauri:",
7081
"tauri://localhost"
7182
],
7283
"style-src": [

frontend/package-lock.json

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

0 commit comments

Comments
 (0)