feathermost/rundev.sh
Midgard 87808a3ffe
Fix CORS: make mitmproxy intercept OPTIONS
Mattermost doesn't support OPTIONS so we have to handle it in our proxy.
2020-03-25 22:14:00 +01:00

15 lines
355 B
Bash
Executable file

#!/bin/bash
MATTERMOST_REMOTE="https://mattermost.zeus.gent"
if [[ $MATTERMOST_REMOTE == */ ]]; then
echo "MATTERMOST_REMOTE should not end with a slash (it should only the protocol and the domain; no path)" >&2
exit 1
fi
cd "$(dirname "$0")"
python3 -m "http.server" >/dev/null 2>&1 &
mitmproxy -s etc/mitm_cors.py -m "reverse:$MATTERMOST_REMOTE"