diff --git a/app/controllers/admin/dfc_product_imports_controller.rb b/app/controllers/admin/dfc_product_imports_controller.rb index d76e42e704..ff5386f662 100644 --- a/app/controllers/admin/dfc_product_imports_controller.rb +++ b/app/controllers/admin/dfc_product_imports_controller.rb @@ -42,13 +42,21 @@ module Admin 'Authorization' => "Bearer #{spree_current_user.oidc_account.token}", } ) - response = PrivateAddressCheck.only_public_connections do + response = only_public_connections do connection.get(url) end response.body end + def only_public_connections + return yield if Rails.env.development? + + PrivateAddressCheck.only_public_connections do + yield + end + end + # Most of this code is the same as in the DfcProvider::SuppliedProductsController. def import_product(subject, enterprise) return unless subject.is_a? DataFoodConsortium::Connector::SuppliedProduct