bblimke/webmock · error · WebMock::NetConnectNotAllowedError

Real HTTP connections are disabled. Unregistered request: #{

Error message

Real HTTP connections are disabled. Unregistered request: #{request_signature}

What it means

Error "Real HTTP connections are disabled. Unregistered request: #{request_signature}" thrown in bblimke/webmock.

Source

Thrown at lib/webmock/http_lib_adapters/curb_adapter.rb:85

        WebMock::RequestRegistry.instance.requested_signatures.put(request_signature)

        if webmock_response = WebMock::StubRegistry.instance.response_for_request(request_signature)
          build_curb_response(webmock_response)
          WebMock::CallbackRegistry.invoke_callbacks(
            {lib: :curb}, request_signature, webmock_response)
          invoke_curb_callbacks
          true
        elsif WebMock.net_connect_allowed?(request_signature.uri)
          res = yield
          if WebMock::CallbackRegistry.any_callbacks?
            webmock_response = build_webmock_response
            WebMock::CallbackRegistry.invoke_callbacks(
              {lib: :curb, real_request: true}, request_signature,
                webmock_response)
          end
          res
        else
          raise WebMock::NetConnectNotAllowedError.new(request_signature)
        end
      end

      def build_request_signature
        method = @webmock_method.to_s.downcase.to_sym

        uri = WebMock::Util::URI.heuristic_parse(self.url)
        uri.path = uri.normalized_path.gsub("[^:]//","/")

        headers = headers_as_hash(self.headers).merge(basic_auth_headers)

        request_body = case method
        when :post, :patch
          self.post_body || @post_body
        when :put
          @put_data
        else
          nil

View on GitHub (pinned to b187df8827)

When it happens

Trigger: Thrown at lib/webmock/http_lib_adapters/curb_adapter.rb:85 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of bblimke/webmock@b187df8827 (2026-08-23). Data as JSON: /api/errors/b96e5b12602650b8. Report an issue: GitHub.