Skip to content

fix: stop using UPGRADE_REQUIRED for client version check#902

Merged
aldbr merged 2 commits into
DIRACGrid:mainfrom
HeloiseJoffe:fix/http-error-client-check
Apr 22, 2026
Merged

fix: stop using UPGRADE_REQUIRED for client version check#902
aldbr merged 2 commits into
DIRACGrid:mainfrom
HeloiseJoffe:fix/http-error-client-check

Conversation

@HeloiseJoffe
Copy link
Copy Markdown
Contributor

Closes #542

Change:
Replace UPGRADE_REQUIRED (426) with PRECONDITION_FAILED (412)

@aldbr
Copy link
Copy Markdown
Contributor

aldbr commented Apr 22, 2026

In the issue, we agreed on using BAD_REQUEST, can you explain why you decided to use PRECONDITION_FAILED?

@HeloiseJoffe
Copy link
Copy Markdown
Contributor Author

I saw BAD_REQUEST as an example rather than a strict choice. I used PRECONDITION_FAILED because the request itself is valid, but it does not satisfy the requirement enforced by the server, which felt closer to a precondition than a malformed request.

That said, I’m fine switching to BAD_REQUEST if we prefer keeping it simpler and more general.

@aldbr
Copy link
Copy Markdown
Contributor

aldbr commented Apr 22, 2026

Thanks for the explanation, it's true that BAD_REQUEST does not appear as the final choice from my comment in the issue indeed. The reasoning makes sense, but I would still lean toward BAD_REQUEST:

  • 412 PRECONDITION_FAILED does not seem to fully match with our case: https://developer.mozilla.org/en-US/docs/Web/HTTP/Reference/Status/412

    The HTTP 412 Precondition Failed client error response status code indicates that access to the target resource was denied. This happens with conditional requests on methods other than GET or HEAD when the condition defined by the If-Unmodified-Since or If-Match headers is not fulfilled. In that case, the request (usually an upload or a modification of a resource) cannot be made and this error response is sent back.

  • 400 seems more generic and details would come from the returned JSON.

@aldbr aldbr merged commit 346e522 into DIRACGrid:main Apr 22, 2026
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Stop using UPGRADE_REQUIRED

2 participants