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 #3500 Add escape logic for header #3503

Merged
merged 1 commit into from
Feb 19, 2023

Conversation

t0rchwo0d
Copy link
Contributor

@t0rchwo0d t0rchwo0d commented Feb 17, 2023

Hi, @appleboy, @thinkerou

Excuse me, I again think about #3500
I'm sorry to bother you.

. delimiter & Repeated / delimiter was judged to need to be delete and merge,
So, I request PR again.

  • Remove characters outside the allowed range (alphabets, numeric, -, /)
  • Merge Repeated / delimiters into one
  • Add Test Case

@codecov
Copy link

codecov bot commented Feb 17, 2023

Codecov Report

Merging #3503 (69e306f) into master (81ac7d5) will not change coverage.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##           master    #3503   +/-   ##
=======================================
  Coverage   98.63%   98.63%           
=======================================
  Files          42       42           
  Lines        3151     3151           
=======================================
  Hits         3108     3108           
  Misses         29       29           
  Partials       14       14           
Flag Coverage Δ
98.63% <100.00%> (ø)
go-1.16 ∅ <ø> (?)
go-1.17 98.54% <100.00%> (ø)
go-1.18 98.54% <100.00%> (ø)
go-1.19 98.63% <100.00%> (ø)
go-1.20 98.63% <100.00%> (ø)
macos-latest 98.63% <100.00%> (ø)
ubuntu-latest 98.63% <100.00%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
gin.go 99.19% <100.00%> (ø)

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

@appleboy appleboy added this to the v1.9 milestone Feb 17, 2023
t0rchwo0d

This comment was marked as outdated.

@t0rchwo0d t0rchwo0d force-pushed the fix-3500-add-escape-logic branch 2 times, most recently from 2deb996 to 2c2e15f Compare February 17, 2023 15:15
t0rchwo0d

This comment was marked as outdated.

@t0rchwo0d
Copy link
Contributor Author

t0rchwo0d commented Feb 17, 2023

I finished the exception handling that cases I was considering.
If / is continuous , all of it was not removed, so I added logic with Test case.

  • Remove characters outside the allowed range (alphabets, numeric, -, /)
  • Merge Repeated / delimiters into one
  • Add Test Case

gin.go Outdated Show resolved Hide resolved
@t0rchwo0d t0rchwo0d requested review from appleboy and removed request for thinkerou February 18, 2023 05:32
gin.go Outdated Show resolved Hide resolved
@t0rchwo0d
Copy link
Contributor Author

Update - Initialize regular expressions only once and simplify logic

@t0rchwo0d
Copy link
Contributor Author

Update - Test Case

@appleboy appleboy merged commit 4cee78f into gin-gonic:master Feb 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants