Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Steve returns HttpStatus.UNAUTHORIZED when ChargeBoxId is not allowed to connect #1020

Closed
3 of 4 tasks
tintigx opened this issue Jan 3, 2023 · 1 comment · Fixed by #1021
Closed
3 of 4 tasks

Steve returns HttpStatus.UNAUTHORIZED when ChargeBoxId is not allowed to connect #1020

tintigx opened this issue Jan 3, 2023 · 1 comment · Fixed by #1021

Comments

@tintigx
Copy link

tintigx commented Jan 3, 2023

Hi,

Checklist

  • I checked other issues already, but found no answer/solution
  • I checked the documentation and wiki, but found no answer/solution
  • I am running the latest version and the issue still occurs
  • I am sure that this issue is about SteVe (and not about the charging station software or something unrelated to SteVe)

Specifications

SteVe Version     : 3.5.0
Operating system  : W10
JDK               : ...
Database          : ...

Expected Behavior

According to "Open Charge Point Protocol JSON1.6, OCPP-J 1.6 Specification" if the Central System does not recognize the charge point identifier in the URL path, it SHOULD send an HTTP response with status 404 and abort the WebSocket connection as described in [RFC6455].

Actual Behavior

Steve returns HttpStatus.UNAUTHORIZED = 401

See OcppWebSocketHandshakeHandler.java
if (!allowConnection) {
log.error("ChargeBoxId '{}' is not recognized.", chargeBoxId);
response.setStatusCode(HttpStatus.UNAUTHORIZED);
return false;
}

The OCPP Spec indicates that the Central System SHOULD return 404, why does Steve returns 401 ?

@goekay
Copy link
Member

goekay commented Jan 4, 2023

good catch, fixing it. thanks!

goekay added a commit that referenced this issue Jan 8, 2023
…statusunauthorized-when-chargeboxid-is-not-allowed-to-connect

set the correct http status if chargeboxid is not recognized (#1020)
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 a pull request may close this issue.

2 participants