added debug for headers received
This commit is contained in:
@@ -191,6 +191,7 @@ If you receive a different response, refer to the Troubleshooting section below.
|
|||||||
## Troubleshooting
|
## Troubleshooting
|
||||||
|
|
||||||
* **Check Backend Logs:** `docker logs flic-webhook-webpush`. Look for errors related to configuration, file access, JSON parsing, authentication, or sending push notifications.
|
* **Check Backend Logs:** `docker logs flic-webhook-webpush`. Look for errors related to configuration, file access, JSON parsing, authentication, or sending push notifications.
|
||||||
|
* The server logs all headers received from Flic requests to help with debugging. Look for lines starting with `DEBUG - All headers received:` to see all headers sent by the Flic button.
|
||||||
* **Check Traefik Logs:** `docker logs traefik`. Look for routing errors or certificate issues.
|
* **Check Traefik Logs:** `docker logs traefik`. Look for routing errors or certificate issues.
|
||||||
* **Verify `.env`:** Ensure all required variables are set correctly, especially VAPID keys and Traefik settings.
|
* **Verify `.env`:** Ensure all required variables are set correctly, especially VAPID keys and Traefik settings.
|
||||||
* **Verify `labels`:** Double-check that variables were correctly substituted manually and match your `.env` and Traefik setup.
|
* **Verify `labels`:** Double-check that variables were correctly substituted manually and match your `.env` and Traefik setup.
|
||||||
|
|||||||
@@ -222,6 +222,12 @@ app.get('/flic-webhook', authenticateFlicRequest, async (req, res) => {
|
|||||||
// Get click_type from query parameter instead of request body
|
// Get click_type from query parameter instead of request body
|
||||||
const click_type = req.query.click_type;
|
const click_type = req.query.click_type;
|
||||||
|
|
||||||
|
// Debug: Log all headers received from Flic
|
||||||
|
console.log('DEBUG - All headers received:');
|
||||||
|
Object.keys(req.headers).forEach(headerName => {
|
||||||
|
console.log(` ${headerName}: ${req.headers[headerName]}`);
|
||||||
|
});
|
||||||
|
|
||||||
console.log(`Received GET webhook: Button=${buttonName}, Type=${click_type}, Timestamp=${timestamp || 'N/A'}`);
|
console.log(`Received GET webhook: Button=${buttonName}, Type=${click_type}, Timestamp=${timestamp || 'N/A'}`);
|
||||||
|
|
||||||
// Basic validation
|
// Basic validation
|
||||||
|
|||||||
Reference in New Issue
Block a user