buggregator / server

Buggregator is a lightweight, standalone server that offers a range of debugging features for PHP applications.
https://buggregator.dev/
Other
648 stars 23 forks source link

Http dumps not working #108

Closed gander closed 9 months ago

gander commented 9 months ago

What more can I say? Whatever I send, I get a 404 and no result in the panel. How do I provide more details?

GET http://http-dump@localhost:8000/user/3/update
HTTP/1.1 404 Not Found
Server: nginx/1.20.2
Date: Sun, 03 Dec 2023 20:58:54 GMT
Content-Length: 0
Connection: keep-alive
Vary: Origin
<Response body is empty>

Response code: 404 (Not Found); Time: 2ms (2 ms); Content length: 0 bytes (0 B)
services:
    buggregator:
        image: ghcr.io/buggregator/server:latest
        pull_policy: always
        restart: always
        ports:
            - 127.0.0.1:8000:8000
butschster commented 9 months ago

Thanks for the bug report!

I've reviewed the code and realized that http-dump doesn't support detection using HTTP user info (http://http-dump@...). However, you can use an alternative method involving headers. Buggregator can send events for any module using HTTP headers. You can send a request with a header as shown in the example below.

$headers = ['X-Buggregator-Event' => 'http-dump'];

Here, http-dump is the module name.

I'll work on enabling event sending with event types specified via user info.

gander commented 9 months ago

Hmmm

POST http://localhost:8000/user/3/update
X-Buggregator-Event: http-dump
Content-Type: application/json

{"name": "John Doe"}

This way it's working

obraz

butschster commented 9 months ago

There is also a PR https://github.com/buggregator/server/pull/112 via HTTP user option

Thx for the feedback!