Skip to content

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

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

Merged
merged 1 commit into from
May 1, 2025
Merged

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/sample@sample.com/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/sample@sample.com/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/sample@sample.com/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/sample@sample.com/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).
Report is 1 commits behind head on v2.

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.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbsulliv Thanks for the PR. Please apply the requested changes.

@mbsulliv
Copy link
Author

mbsulliv commented May 1, 2025

I think I have made all the requested changes. Do you need anything else from me?

Copy link
Member

@jeevatkm jeevatkm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@mbsulliv Thanks for the updates.

@jeevatkm jeevatkm merged commit 47780b1 into go-resty:v2 May 1, 2025
8 checks passed
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.

2 participants