Repository navigation
Replace nap with Net::HTTP - #785
Merged
amorde merged 2 commits intoNov 15, 2026
Merged
Conversation
nap's README now asks projects to use Ruby's standard library instead. Add Pod::HTTP.perform, which makes requests with Net::HTTP using its default certificate verification against the system trust store, and use it for URL validation, the GitHub API and metrics. Proxy settings are read from the request URL so https_proxy and no_proxy apply. Pod::HTTP.validate_url now returns a Pod::HTTP::Response, which keeps the status_code, headers, body, ok? and success? readers callers use. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 1, 2026
amorde
approved these changes
Nov 15, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🌈
Replace nap with Net::HTTP
nap's README now asks projects to use Ruby's standard library instead of nap. This replaces it with
Net::HTTP, using its default certificate verification against the system trust store. The CDN source already relies on that same store through Typhoeus.What changed
Pod::HTTP.perform(verb, url, headers = {})makes a request withNet::HTTPand returns aPod::HTTP::Responsestruct (status_code,headers,body,ok?,success?).headerskeeps nap's shape: lowercase names mapping to arrays of values.Pod::HTTP.validate_url,get_actual_url,Pod::GitHubandPod::Metricsuse it. CocoaPods' callers ofvalidate_url(Validator#validate_urland#validate_screenshots) readsuccess?andheaders['content-type'].first, which both still work.validate_urlrescuesURI::InvalidURIErrorplusPod::HTTP::NETWORK_ERRORS, which covers the classes nap grouped underREST::Error.performraisesURI::InvalidURIErrorfor URLs that are not HTTP, sovalidate_urlreturnsnilfor anftp://ormailto:homepage.URI#find_proxy), sohttps_proxyandno_proxyapply. Net::HTTP's own:ENVlookup only readshttp_proxy, even for https requests.napis removed from the gemspec andGemfile.lock, along with the unusedrequire 'rest'incdn_source.rb.Behaviour notes
Pod::HTTP.validate_urlreturnsnilwhen a URL's certificate does not verify against the system trust store.pod lib lintandpod spec lintthen report "There was a problem validating the URL" for that homepage, screenshot, social media or documentation URL. ThePod::GitHubhelpers used bypod spec createraiseOpenSSL::SSL::SSLErrorin the same situation. Users on networks that intercept TLS need their CA in the trust store their Ruby's OpenSSL uses, for example throughSSL_CERT_FILE.Once the related PRs are released, CocoaPods no longer installs nap, so a third-party plugin that calls
RESTwithout declaring nap as a dependency will need to add it. The CHANGELOG entry covers all of this.Tests
New specs in
spec/http_spec.rb:OpenSSL::SSL::SSLErrorwithcertificate verify failedhttps_proxyenvironment setting is passed toNet::HTTPvalidate_urlreturnsnilwhen the request raises a network errorvalidate_urlreturnsnilforftp://andmailto:URLsThe full suite and rubocop pass locally on Ruby 2.6 (macOS system Ruby, LibreSSL), 3.2 and 3.4 (1318 specifications, 0 failures).
Related
gem install cocoapodsno longer installs nap.🤖 Generated with Claude Code