{"push_id":4013446386,"size":1,"distinct_size":1,"ref":"refs/heads/handle-short-card-numbers","head":"a3971511f55d19c68b076513f286d84b6efe7a6e","before":"bdcb4f957ebb74935b0b292d7c5b3079bcaae559","commits":[{"sha":"a3971511f55d19c68b076513f286d84b6efe7a6e","author":{"name":"Russell Howe","email":"96a1df8fdd28b0ed243862d7fa4ec272fd476aba@digital.cabinet-office.gov.uk"},"message":"REP-190: Stop throwing 500s for short card numbers\n\nIf you pass a card number with fewer than 11 characters to cardid, it throws an\ninternal server error.\n\ne.g.\n\n    curl -v -X POST -H 'Content-Type: application/json' -d '{ \"cardNumber\": \"4\"}' http://localhost:8080/v1/api/card\n\nThis is because we call substring(0, 11) on the cardnumber string, which throws\na java.lang.StringIndexOutOfBoundsException on strings shorter than 11\ncharacters.\n\nMake this more robust and return 404 instead.\n\nWe already test CardInformationStore quite thoroughly so the only functionality\nin CardService we need to test is that the lookup key gets truncated\nappropriately.\n\nMove this logic to a separate method and test that specifically.","distinct":true,"url":"https://api.github.com/repos/alphagov/pay-cardid/commits/a3971511f55d19c68b076513f286d84b6efe7a6e"}]}
{"actor":{"display_login":"rhowe-gds"}}