fix: small bugfixes based on my experience migrating my site

This commit is contained in:
Mya 2022-06-09 15:00:23 -05:00
parent 658a4016fb
commit 2c7aea4654
No known key found for this signature in database
GPG Key ID: C3ECFA648DAD27FA
2 changed files with 8 additions and 2 deletions

@ -52,9 +52,13 @@ var (
Action: func(ctx *cli.Context) error { Action: func(ctx *cli.Context) error {
log := zaputil.Extract(ctx.Context) log := zaputil.Extract(ctx.Context)
// additional mime-types that need to be explicitly registered
_ = mime.AddExtensionType(".woff2", "application/font-woff2") _ = mime.AddExtensionType(".woff2", "application/font-woff2")
_ = mime.AddExtensionType(".woff", "application/font-woff") _ = mime.AddExtensionType(".woff", "application/font-woff")
_ = mime.AddExtensionType(".ttf", "font/ttf") _ = mime.AddExtensionType(".ttf", "font/ttf")
_ = mime.AddExtensionType(".yaml", "application/yaml")
_ = mime.AddExtensionType(".yml", "application/yaml")
_ = mime.AddExtensionType(".json", "application/json")
gitService := git.NewService(hostConfig.Git) gitService := git.NewService(hostConfig.Git)
err := gitService.Load(ctx.Context) err := gitService.Load(ctx.Context)

@ -18,11 +18,13 @@
import {ulid} from 'ulid'; import {ulid} from 'ulid';
const secure = window.location.protocol === "https:";
const protocol = secure ? "wss:" : "ws:";
const sessionPrefix = "/_session"; const sessionPrefix = "/_session";
const domain = window.location.host; const domain = window.location.host + (secure ? ":443" : "");
async function main() { async function main() {
const ws = new WebSocket(`ws://${domain}${sessionPrefix}${window.location.pathname}`); const ws = new WebSocket(`${protocol}//${domain}${sessionPrefix}${window.location.pathname}`);
const message = `{"ID":"${ulid()}","FullName":"ping"}` const message = `{"ID":"${ulid()}","FullName":"ping"}`
let id = null; let id = null;