ho-nl / docker-development-box

🐳 Reach Digital Magento 2 Docker+local hybrid devbox 🐳
Apache License 2.0
19 stars 4 forks source link

Also map to xdebug backend if XDEBUG_SESSION is passed via query parameters #100

Open hnsr opened 2 years ago

hnsr commented 2 years ago

Currently we automatically map to the xdebug backend based on the XDEBUG_SESSION cookie being set, but not via the query parameter that xdebug also supports as activation trigger (https://xdebug.org/docs/step_debug#manual-init)

Supporting query parameter activation would make debugging things like GraphQL calls (or any API calls) a lot easier

Currently we map based on $cookie_* in our nginx config: https://github.com/ho-nl/docker-development-box/blob/master/nginx/conf.d/default.conf#L2-L5

Changing this to $query is trivial, but we need to combine the two somehow to support both activation mechanisms

hnsr commented 2 years ago

Regarding using cookies for debugging graphql calls:

Ben er nog wat verder ingedoken, maar de reden dat zo'n xdebug cookie instellen via een webbased GraphQL IDE zo lastig is komt door https://stackoverflow.com/a/12867391 Ik heb geprobeerd dit alsnog mogelijk te maken door de request.includeCredentials instelling (zie https://github.com/graphql/graphql-playground/issues/791#issuecomment-455286053) die GraphQL Playground heeft i.c.m. met deze M2 CORS module: https://github.com/graycoreio/magento2-cors/blob/master/docs/stories/configuring-the-headers.md (met de juiste config rondom allowed headers en allowed credentials), maar het werkt alsnog niet.. Dus ik denk dat meegeven via query param en een extra stukje config toevoegen aan https://github.com/ho-nl/docker-development-box/blob/master/nginx/conf.d/default.conf de beste manier is