-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
Merging to release-5.3: [TT-13021]Transfer encoding fix (#6770) #6783
Merging to release-5.3: [TT-13021]Transfer encoding fix (#6770) #6783
Conversation
### **User description** <!-- Provide a general summary of your changes in the Title above --> TASK: https://tyktech.atlassian.net/browse/TT-13021 ## Description <!-- Describe your changes in detail --> ## Related Issue <!-- This project only accepts pull requests related to open issues. --> <!-- If suggesting a new feature or change, please discuss it in an issue first. --> <!-- If fixing a bug, there should be an issue describing it with steps to reproduce. --> <!-- OSS: Please link to the issue here. Tyk: please create/link the JIRA ticket. --> ## Motivation and Context <!-- Why is this change required? What problem does it solve? --> ## How This Has Been Tested <!-- Please describe in detail how you tested your changes --> <!-- Include details of your testing environment, and the tests --> <!-- you ran to see how your change affects other areas of the code, etc. --> <!-- This information is helpful for reviewers and QA. --> ## Screenshots (if appropriate) ## Types of changes <!-- What types of changes does your code introduce? Put an `x` in all the boxes that apply: --> - [ ] Bug fix (non-breaking change which fixes an issue) - [ ] New feature (non-breaking change which adds functionality) - [ ] Breaking change (fix or feature that would cause existing functionality to change) - [ ] Refactoring or add test (improvements in base code or adds test coverage to functionality) ## Checklist <!-- Go over all the following points, and put an `x` in all the boxes that apply --> <!-- If there are no documentation updates required, mark the item as checked. --> <!-- Raise up any additional concerns not covered by the checklist. --> - [ ] I ensured that the documentation is up to date - [ ] I explained why this PR updates go.mod in detail with reasoning why it's required - [ ] I would like a code coverage CI quality gate exception and have explained why ___ ### **PR Type** Bug fix, Enhancement ___ ### **Description** - Fixed an issue with reading and resetting the request body in the URL rewrite middleware to ensure downstream handlers can process it correctly. - Enhanced regex matching logic in the URL rewrite middleware, including improved context data handling. - Extended the tracing functionality to support OAS definitions by adding a new field in the trace request structure and implementing extraction logic. - Improved error handling for malformed or incomplete trace requests. ___ ### **Changes walkthrough** 📝 <table><thead><tr><th></th><th align="left">Relevant files</th></tr></thead><tbody><tr><td><strong>Bug fix</strong></td><td><table> <tr> <td> <details> <summary><strong>mw_url_rewrite.go</strong><dd><code>Improve request body handling and regex matching in URL rewrite </code><br><code>middleware</code></dd></summary> <hr> gateway/mw_url_rewrite.go <li>Added error handling for reading the request body.<br> <li> Reset the request body to allow downstream handlers to read it.<br> <li> Enhanced regex matching logic and updated context data handling.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6770/files#diff-84a6a5c810334aaa8702669f2aebf0284f116d83e8a55ec9d1d5b8bae87f1be6">+20/-1</a> </td> </tr> </table></td></tr><tr><td><strong>Enhancement</strong></td><td><table> <tr> <td> <details> <summary><strong>tracing.go</strong><dd><code>Extend tracing functionality to support OAS definitions</code> </dd></summary> <hr> gateway/tracing.go <li>Extended trace request structure to include OAS definitions.<br> <li> Added logic to extract and log OAS definitions into API definitions.<br> <li> Improved error handling for missing or malformed trace requests.<br> </details> </td> <td><a href="https://github.com/TykTechnologies/tyk/pull/6770/files#diff-0069987d730b02812808925a17e1434ca7558a4dfc8661beb27ccd11afb8c77d">+8/-2</a> </td> </tr> </table></td></tr></tr></tbody></table> ___ > 💡 **PR-Agent usage**: Comment `/help "your question"` on any pull request to receive relevant information --------- Co-authored-by: lghiur <[email protected]> (cherry picked from commit 1b2df0e)
API Changes no api changes detected |
PR Reviewer Guide 🔍Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Explore these optional code suggestions:
|
Quality Gate failedFailed conditions |
User description
TT-13021Transfer encoding fix (#6770)
User description
TASK: https://tyktech.atlassian.net/browse/TT-13021
Description
Related Issue
Motivation and Context
How This Has Been Tested
Screenshots (if appropriate)
Types of changes
functionality to change)
coverage to functionality)
Checklist
why it's required
explained why
PR Type
Bug fix, Enhancement
Description
rewrite middleware to ensure downstream handlers can process it
correctly.
improved context data handling.
adding a new field in the trace request structure and implementing
extraction logic.
Changes walkthrough 📝
mw_url_rewrite.go
Improve request body handling and regex matching in URL rewrite
middleware
gateway/mw_url_rewrite.go
tracing.go
Extend tracing functionality to support OAS definitions
gateway/tracing.go
Co-authored-by: lghiur [email protected]
PR Type
Bug fix, Enhancement
Description
mw_url_rewrite.go
with reading and resetting the request body to ensure downstream handlers can process it correctly.mw_validate_json.go
to replace deprecatedioutil.ReadAll
withio.ReadAll
and ensured proper request body handling.tracing.go
to support OAS definitions by adding a new field in the trace request structure and implementing extraction logic.mw_url_rewrite_test.go
to validate payload triggers and ensure request body integrity.Changes walkthrough 📝
mw_url_rewrite.go
Improve request body handling and regex matching in URL rewrite
middleware
gateway/mw_url_rewrite.go
mw_validate_json.go
Update JSON validation logic and request body handling
gateway/mw_validate_json.go
ioutil.ReadAll
withio.ReadAll
for reading request body.mw_url_rewrite_test.go
Add and enhance tests for URL rewrite middleware
gateway/mw_url_rewrite_test.go
integrity.
tracing.go
Extend tracing functionality to support OAS definitions
gateway/tracing.go