Skip to content

Commit 919c380

Browse files
committed
fix: enterprise requests getting blocked by CSP. Require HTTPS
1 parent 1c1016f commit 919c380

File tree

4 files changed

+6
-7
lines changed

4 files changed

+6
-7
lines changed

_locales/en/messages.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,9 @@
130130
"account_enterprise-preconfig": {
131131
"message": "GitHub Enterprise ($1)"
132132
},
133+
"account_enterprise-pat": {
134+
"message": "GitHub Enterprise (Personal access token)"
135+
},
133136
"addAccount": {
134137
"message": "Add account"
135138
},

manifest.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@
3434
}
3535
]
3636
},
37-
"content_security_policy": "default-src 'self'; connect-src https://api.github.com https://github.com; object-src 'none'; img-src 'self' data:",
37+
"content_security_policy": "default-src 'self'; connect-src https://api.github.com https://github.com https://*; object-src 'none'; img-src 'self' data:",
3838
"default_locale": "en",
3939
"description": "__MSG_description__",
4040
"name": "__MSG_name__",

options.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
</p>
3737
<p class="browser-style">
3838
<label for="enterprise-url" data-l10n-id="instanceURL">Instance URL</label>
39-
<input type="url" id="enterprise-url" class="browser-style" name="instanceURL" disabled>
39+
<input type="url" id="enterprise-url" class="browser-style" name="instanceURL" pattern="https://.+" placeholder="https://example.com" disabled>
4040
</p>
4141
<small data-l10n-id="enterprise_redirect">The redirect URL is "https://localhost/github-auth"</small>
4242
</fieldset>
@@ -56,7 +56,7 @@
5656
</p>
5757
<p class="browser-style">
5858
<label for="enterprise-pat-url" data-l10n-id="instanceURL">Instance URL</label>
59-
<input type="url" id="enterprise-pat-url" class="browser-style" name="instanceURL" disabled>
59+
<input type="url" id="enterprise-pat-url" class="browser-style" name="instanceURL" pattern="https://.+" placeholder="https://example.com" disabled>
6060
</p>
6161
</fieldset>
6262
<button class="browser-style" type="submit" data-l10n-id="addAccount">Add account</button>

scripts/options.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -150,10 +150,6 @@ class AccountManager extends window.StorageManager {
150150
}
151151

152152
if(type === 'enterprise') {
153-
if(!details.instanceURL.startsWith('https:')) {
154-
this.showError("Instance must be reachable via HTTPS for OAuth");
155-
return;
156-
}
157153
let permissionURL = details.instanceURL;
158154
if(!permissionURL.endsWith('/')) {
159155
permissionURL += '/';

0 commit comments

Comments
 (0)