datenanfragen / website

The Datenanfragen.de website including the request PDF generator and company information database
https://www.datenanfragen.de
MIT License
92 stars 125 forks source link

Submitting suggestions is broken #1060

Closed RokkuCode closed 1 year ago

RokkuCode commented 1 year ago

Using the current stable Vivaldi (Chrome based Browser) throws an error:

Acess to fetch at 'https://backend.datenanfragen.de/suggest' from origin 'https://www.datenanfragen.de' has been blocked by CORS policy: Response to preflight request doesn't pass access control check: No 'Access-Control-Allow-Origin' header is present on the requested resource. If an opaque response serves your needs, set the request's mode to 'no-cors' to fetch the resource with CORS disabled.

Debug information:

{
    "message": "Uncaught TypeError: Failed to fetch",
    "type": "error",
    "colno": 18078,
    "filename": "https://www.datenanfragen.de/js/commons.bundle.gen.js",
    "lineno": 18,
    "error": {
        "message": "Failed to fetch",
        "description": "POSTing the suggestion failed.",
        "name": "TypeError",
        "stack": "TypeError: Failed to fetch\n    at document.getElementById.onclick (https://www.datenanfragen.de/js/suggest-edit.bundle.gen.js:18:138882)",
        "enduser_message": "Beim Absenden deines Vorschlags ist leider ein Fehler aufgetreten. Bitte stelle sicher, dass Du mit dem Internet verbunden bist und Anfragen an backend.datenanfragen.de nicht mit einem Add-On wie uMatrix oder NoScript blockierst.",
        "context": {
            "submitUrl": "https://backend.datenanfragen.de/suggest",
            "body": "{\"for\":\"cdb\",\"data\":{\"slug\":\"gmf-gmbh\",\"relevant-countries\":[\"de\"],\"categories\":[\"collection agency\"],\"name\":\"GMF Gesellschaft für innovatives Forderungsmanagement mbH\",\"address\":\"Markgräflerstr. 12\\n70329 Stuttgart\",\"phone\":\"+49 711 9011450\",\"fax\":\"+49 711 90114579\",\"email\":\"info@gmf-gmbh.de\",\"web\":\"https://www.gmf-gmbh.de\",\"sources\":[\"https://www.gmf-gmbh.de\"],\"suggested-transport-medium\":\"fax\",\"quality\":\"verified\"},\"new\":true}"
        }
    },
    "defaultPrevented": false,
    "eventPhase": 2,
    "isTrusted": true,
    "returnValue": true,
    "code_version": "1.0.0",
    "user_agent": "Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/112.0.0.0 Safari/537.36",
    "url": {
        "ancestorOrigins": {},
        "href": "https://www.datenanfragen.de/suggest#!type=new&for=cdb&name=GMF",
        "origin": "https://www.datenanfragen.de",
        "protocol": "https:",
        "host": "www.datenanfragen.de",
        "hostname": "www.datenanfragen.de",
        "port": "",
        "pathname": "/suggest",
        "search": "",
        "hash": "#!type=new&for=cdb&name=GMF"
    }
}
baltpeter commented 1 year ago

Thanks for the report, @RokkuCode! This seems to have been a problem with our backend that should be fixed by https://github.com/datenanfragen/backend/pull/68.

baltpeter commented 1 year ago

The fix has now been merged and should have fixed this.