
Security Fundamentals
Turtles, Clams, and Cyber Threat Actors: Shell Usage
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
api_pagination_headers
Advanced tools
Adds pagination info to a
Link
response header.
This technique is considered to be a best practice for REST APIs and is currently used by GitHub. The gem also adds the total number of records into a Total-Count
header.
Support for rails-api is built in.
Example
Link: <http://example.com/posts?page=2&per_page=10>; rel="next", <http://example.com/posts?page=2&per_page=10>; rel="last"
Total-Count: 11
Include in your Gemfile:
gem 'api_pagination_headers'
class PostsController < ApplicationController
after_action only: [:index] { set_pagination_headers(:posts) }
def index
@posts = Post.all.paginate(per_page: params[:per_page], page: params[:page])
respond_with @posts
end
end
ApiPaginationHeaders.configure do |config|
# Change total count header title (default: 'Total-Count')
config.total_count_header = 'X-Total-Count'
# Force HTTPS (default: false)
config.force_https = true
end
MIT © Richard Käll
FAQs
Unknown package
We found that api_pagination_headers demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security Fundamentals
The Socket Threat Research Team uncovers how threat actors weaponize shell techniques across npm, PyPI, and Go ecosystems to maintain persistence and exfiltrate data.
Security News
At VulnCon 2025, NIST scrapped its NVD consortium plans, admitted it can't keep up with CVEs, and outlined automation efforts amid a mounting backlog.
Product
We redesigned our GitHub PR comments to deliver clear, actionable security insights without adding noise to your workflow.