Fix CORS and Mixed-Content issue & Bug Fixes
This fixes the following issues: - Text selection color was incorrect - The 'send again' button glitched on page load This also adds some finishing touches to the proxy code (closes #199) and that in turn resolves #175 and resolves #2 Finally, this adds the fonts to the application assets allowing them to be cached by the service worker.
This commit is contained in:
@@ -8,11 +8,13 @@ app.use(bodyParser.json());
|
||||
|
||||
app.use((req, res, next) => {
|
||||
res.header('Access-Control-Allow-Origin', '*');
|
||||
res.header('Access-Control-Allow-Headers', '*');
|
||||
next();
|
||||
});
|
||||
|
||||
app.post('/', async function(req, res) {
|
||||
app.post('/', async (req, res) => {
|
||||
const {method, url, auth, headers, data} = req.body;
|
||||
|
||||
try {
|
||||
const payload = await axios({
|
||||
method,
|
||||
@@ -20,9 +22,9 @@ app.post('/', async function(req, res) {
|
||||
auth,
|
||||
headers,
|
||||
data
|
||||
})
|
||||
});
|
||||
|
||||
return res.json({
|
||||
return await res.json({
|
||||
data: payload.data,
|
||||
status: payload.status,
|
||||
statusText: payload.statusText,
|
||||
@@ -32,7 +34,7 @@ app.post('/', async function(req, res) {
|
||||
} catch(error) {
|
||||
if(error.response) {
|
||||
const errorResponse = error.response;
|
||||
return res.json({
|
||||
return await res.json({
|
||||
data: errorResponse.data,
|
||||
status: errorResponse.status,
|
||||
statusText: errorResponse.statusText,
|
||||
|
||||
Reference in New Issue
Block a user