Unleash / unleash-edge

MIT License
48 stars 8 forks source link

HTTP status code for "NOT READY" #460

Closed ivarconr closed 4 months ago

ivarconr commented 4 months ago

Describe the bug

Today when edge is not considered ready you get a json response explaining it is not ready with a 200 status code. I think it would be more appropriate to use 503 Service Unavailable.

Steps to reproduce the bug

  1. start edge (with invalid url or token)
  2. curl ready endpoint: curl localhost:3063/internal-backstage/ready
  3. inspect response:
    
    HTTP/1.1 200 OK
    content-encoding: gzip
    content-type: application/json
    date: Wed, 08 May 2024 18:21:25 GMT
    etag: W/"15-NytVk1xF3R-LK3QpS5Swfg=="
    transfer-encoding: chunked
    vary: accept-encoding, Origin, Access-Control-Request-Method, Access-Control-Request-Headers

{ "status": "NOTREADY" }



### Expected behavior

Use status code  [503 Service Unavailable](https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/503) instead of "200". 

### Logs, error output, etc.

_No response_

### Screenshots

_No response_

### Additional context

_No response_

### Unleash version

_No response_

### Subscription type

None

### Hosting type

None

### SDK information (language and version)

_No response_
ivarconr commented 4 months ago

solved in 19.1.2