* feat: refine hijack behavior for response lifecycle and add tests
- Clarify the error message for attempted hijack after response body data is written
- Modify hijack behavior: allow hijacking after headers are written (for better websocket compatibility), but block hijacking after any body data is sent
- Add comprehensive tests to validate allowed hijack after header write and disallowed hijack after body write
fix https://github.com/gin-gonic/gin/issues/4372
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* test: use require for immediate test failure on errors
- Replace assert with require for error checks to ensure test failures immediately halt execution
Signed-off-by: appleboy <appleboy.tw@gmail.com>
* Update response_writer.go
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
---------
Signed-off-by: appleboy <appleboy.tw@gmail.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
- Change the update schedule for both gomod and GitHub Actions dependencies from weekly to daily
- Add grouping for GitHub Actions updates using a catch-all pattern
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Rewrite and expand the contributing guidelines for clarity and thoroughness
- Add distinct sections for Issues and Pull Requests with step-by-step instructions
- Include links to documentation, user guides, and the discussions forum
- Provide advice for reporting bugs and making feature requests
- Specify requirements for pull requests, including branch, commit count, and test coverage
- Clarify documentation expectations for new features and reference the pull request checklist
- Add guidance for security-related bug reports and communication language
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Replace the old issue template with new, structured YAML templates for bug reports and feature requests
- Add a configuration file that directs users to relevant documentation and support links
- Update the pull request template to use a checklist format and clarify documentation requirements
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update contributing header to single hash style
- Remove deprecated badge and improve project summary wording
- Reorganize and clarify feature descriptions and benefits
- Restructure getting started and installation instructions for clarity
- Expand and annotate the first example application walkthrough
- Detail the steps for running the sample application and expected output
- Improve guidance on learning resources and example projects
- Enhance API reference, documentation links, and tutorial references
- Add a clear performance benchmarks section comparing Gin to other frameworks
- Expand middleware section with ecosystem highlights and usage details
- Create a production usage section listing notable projects using Gin
- Revamp contribution section with clearer procedure and encouragement for new contributors
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Add a GitHub Actions job for vulnerability scanning using Trivy
- Configure Trivy to scan the repository for vulnerabilities of severity critical, high, and medium
- Ensure the workflow fails if vulnerabilities are found
Signed-off-by: appleboy <appleboy.tw@gmail.com>
- Update GitHub Actions workflow to include Go 1.25 in the test matrix
- This change expands the range of Go versions tested for the project
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* build(deps): upgrade github.com/bytedance/sonic from v1.13.2 to v1.14.0
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* build(deps): upgrade github.com/bytedance/sonic from v1.13.2 to v1.14.0
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
* test: update expected status code for request too large test
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
---------
Signed-off-by: Flc <four_leaf_clover@foxmail.com>
- Add TestMappingSliceOfCustomBindUnmarshalerElementsUri with validation for multiple elements, single element, and error cases
- Add TestMappingSliceOfCustomBindUnmarshalerElementsForm with comprehensive test coverage including large slices
- Add TestMappingArrayOfCustomBindUnmarshalerElementsUri with exact array size validation and error handling
- Add TestMappingArrayOfCustomBindUnmarshalerElementsForm with proper error case coverage
- Enhance test coverage for custom BindUnmarshaler slice and array functionality
* test: add comprehensive unit tests for Context.File() method
- Add TestContextFile with multiple test scenarios in context_test.go
- Add simplified tests in context_file_test.go
- Cover file serving, 404 handling, directory access, HEAD requests, and Range requests
- All tests pass successfully
* fix: resolve gci formatting issues in test files
* fix: correct test file paths and add test file to gin directory
* move test_file.txt to testdata directory as suggested by maintainer
* fix: update test file paths to use testdata directory
- Fix 'an url' to 'a URL' in logger.go comment
- Fix 'an form' to 'a form' in binding/form_mapping.go comment
- Improve grammar consistency in code documentation