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

Fix off-by-one error in key/value resolution #975

Open
wants to merge 1 commit into
base: v2
Choose a base branch
from

Conversation

mbsulliv
Copy link

Added a test to demonstrate the problem, which yielded this failure in test output: --- FAIL: TestGetPathParamAndPathParams (0.00s)
resty_test.go:44: Method: GET
resty_test.go:45: Path: /v1/users/[email protected]/100002{details}
request_test.go:1838: Expected [true], got [false]
request_test.go:1839: Expected [true], got [false]
resty_test.go:900: Response Status: 200 OK
resty_test.go:901: Response Time: 215.375µs
resty_test.go:902: Response Headers: map[Content-Length:[85] Content-Type:[text/plain; charset=utf-8] Date:[Sat, 22 Feb 2025 01:31:45 GMT]]
resty_test.go:903: Response Cookies: []
resty_test.go:904: Response Body: TestPathParamURLInput: text response: /v1/users/[email protected]/100002%7Bdetails%7D

Once fix was applied, test passed.

Added a test to demonstrate the problem, which yielded this failure in test output:
--- FAIL: TestGetPathParamAndPathParams (0.00s)
    resty_test.go:44: Method: GET
    resty_test.go:45: Path: /v1/users/[email protected]/100002{details}
    request_test.go:1838: Expected [true], got [false]
    request_test.go:1839: Expected [true], got [false]
    resty_test.go:900: Response Status: 200 OK
    resty_test.go:901: Response Time: 215.375µs
    resty_test.go:902: Response Headers: map[Content-Length:[85] Content-Type:[text/plain; charset=utf-8] Date:[Sat, 22 Feb 2025 01:31:45 GMT]]
    resty_test.go:903: Response Cookies: []
    resty_test.go:904: Response Body: TestPathParamURLInput: text response: /v1/users/[email protected]/100002%7Bdetails%7D

Once fix was applied, test passed.
Copy link

codecov bot commented Feb 22, 2025

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 95.69%. Comparing base (1e19d6b) to head (eb92f3d).

Additional details and impacted files
@@           Coverage Diff           @@
##               v2     #975   +/-   ##
=======================================
  Coverage   95.69%   95.69%           
=======================================
  Files          14       14           
  Lines        2207     2207           
=======================================
  Hits         2112     2112           
  Misses         71       71           
  Partials       24       24           

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

1 participant