Skip to content

Fix Retry-After handling #4544

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

Conversation

mhoffrog
Copy link
Contributor

@mhoffrog mhoffrog commented Mar 7, 2023

Description

Please refer to #4543 for details.

  1. We must perform an "inline" sleep on status 503 only
  2. Take the Retry-After value in a more robust way by grepping for the value format in seconds only

This PR closes #4543

Test results

Test data

The test has been run offline by performing the grep command on the following file retry-after_test.txt:

# Test case#1: Upper case chars, space before and after :colon:
Retry-After : 12345

# Test case#2: lower case chars, no space before and nor after :colon:, spaces after the value
retry-after:22345           

# Test case#3: Upper case chars, no space before, space after :colon:, no spaces after value
Retry-After: 32345

# Test case#4: Upper case chars, space before and after :colon:, spaces after value
Retry-After : 42345    

# Test case#5: Upper case chars, no space before, space after :colon:, spaces after value
Retry-after: 52345    

# Test case#6: Lower case chars, HTTP date format for value
retry-after : Sun, 21 Oct 2018 12:16:24 GMT

# Test case#7: Upper case chars, HTTP date format for value
Retry-After : Sun, 21 Oct 2018 12:16:24 GMT

Test run (shell command)

$ grep -i "^Retry-After *: *[0-9]\+ *" retry-after_test.txt | cut -d : -f 2 | tr -d ' ' | tr -d '\r'
12345
22345
32345
42345
52345

@Neilpang Neilpang merged commit bf00d31 into acmesh-official:dev Mar 17, 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.

2 participants