Skip to content

Commit

Permalink
feat: x-ratelimit-used response header (#347)
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Sep 4, 2020
1 parent 46d420f commit 7120576
Show file tree
Hide file tree
Showing 45 changed files with 4,092 additions and 3,532 deletions.
3 changes: 3 additions & 0 deletions lib/normalize/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,9 @@ async function normalize(scenarioState, fixture) {
String(rateLimitRemaining - 1)
);

// Set used rate limit to 1
setIfExists(fixture.headers, "x-ratelimit-used", 1);

// zerofy random stuff
setIfExists(fixture.headers, "etag", '"00000000000000000000000000000000"');
setIfExists(fixture.headers, "x-runtime-rack", "0.000000");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@
"responseIsBinary": false,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"cache-control": "private, max-age=60, s-maxage=60",
"connection": "close",
"content-length": "8215",
Expand All @@ -150,6 +150,7 @@
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4999",
"x-ratelimit-reset": "1507651200000",
"x-ratelimit-used": 1,
"x-xss-protection": "1; mode=block"
}
},
Expand Down Expand Up @@ -284,7 +285,7 @@
"responseIsBinary": false,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"cache-control": "private, max-age=60, s-maxage=60",
"connection": "close",
"content-length": "8217",
Expand All @@ -304,6 +305,7 @@
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4999",
"x-ratelimit-reset": "1507651200000",
"x-ratelimit-used": 1,
"x-xss-protection": "1; mode=block"
}
},
Expand All @@ -323,7 +325,7 @@
"responseIsBinary": false,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"connection": "close",
"content-security-policy": "default-src 'none'",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand All @@ -339,6 +341,7 @@
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4999",
"x-ratelimit-reset": "1507651200000",
"x-ratelimit-used": 1,
"x-xss-protection": "1; mode=block"
}
},
Expand Down Expand Up @@ -400,7 +403,7 @@
"responseIsBinary": false,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"cache-control": "private, max-age=60, s-maxage=60",
"connection": "close",
"content-length": "2254",
Expand All @@ -420,6 +423,7 @@
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4999",
"x-ratelimit-reset": "1507651200000",
"x-ratelimit-used": 1,
"x-xss-protection": "1; mode=block"
}
},
Expand All @@ -438,7 +442,7 @@
"responseIsBinary": false,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"connection": "close",
"content-security-policy": "default-src 'none'",
"date": "Tue, 10 Oct 2017 16:00:00 GMT",
Expand All @@ -454,6 +458,7 @@
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4999",
"x-ratelimit-reset": "1507651200000",
"x-ratelimit-used": 1,
"x-xss-protection": "1; mode=block"
}
},
Expand Down Expand Up @@ -494,7 +499,7 @@
"responseIsBinary": false,
"headers": {
"access-control-allow-origin": "*",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"access-control-expose-headers": "ETag, Link, Location, Retry-After, X-GitHub-OTP, X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Used, X-RateLimit-Reset, X-OAuth-Scopes, X-Accepted-OAuth-Scopes, X-Poll-Interval, X-GitHub-Media-Type, Deprecation, Sunset",
"cache-control": "private, max-age=60, s-maxage=60",
"connection": "close",
"content-length": "1127",
Expand All @@ -514,6 +519,7 @@
"x-ratelimit-limit": "5000",
"x-ratelimit-remaining": "4999",
"x-ratelimit-reset": "1507651200000",
"x-ratelimit-used": 1,
"x-xss-protection": "1; mode=block"
}
}
Expand Down

0 comments on commit 7120576

Please sign in to comment.