Skip to content
This repository was archived by the owner on Apr 5, 2026. It is now read-only.
This repository was archived by the owner on Apr 5, 2026. It is now read-only.

APIClient has multiple critical issues: typos, leaks, and missing features #79

Description

@aliAljaffer

As a developer
I want a robust API client
So that HTTP requests are reliable and secure

Current Issues

1. Typos

  • psot() instead of post() (line 29)
  • setAthenticationToken() instead of setAuthenticationToken() (line 52)
  • delet() instead of delete() (line 59)

2. Resource Leaks

  • BufferedReader never closed in get() (line 19)
  • OutputStream never closed in psot() (line 35)

3. Missing Features

  • No timeout applied despite being set (line 54)
  • Auth token stored but never used in requests (line 52)
  • No content-type header in POST (line 34)
  • isResponseOK() always returns true (line 47)

Location: src/java/APIClient.java

Security Impact

MEDIUM - Auth tokens not applied means requests are unauthenticated

Acceptance Criteria

  • Fix all three typos
  • Use try-with-resources for all streams
  • Apply timeout to connections
  • Add auth token to request headers
  • Implement proper status code checking
  • Set content-type for POST requests
  • Add comprehensive tests

Metadata

Metadata

Assignees

Labels

apiAPI related issuesbugSomething isn't workingjavaJava code issuesresource-leakResource not properly closedsecuritySecurity related issuestypoSpelling or grammar erroruser-storyUser story format issue

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions