Code Monkey home page Code Monkey logo

Comments (5)

kapoorlakshya avatar kapoorlakshya commented on September 13, 2024 1

@lordofthedanse Thanks for reporting that. A better way might be to explicitly list the S3 host in allowed_sites:

allowed_sites = [
  "https://chromedriver.storage.googleapis.com",
  "https://github.com/mozilla/geckodriver/releases",
  %r{/^https:\/\/github-production-release-asset-.+\.s3\.amazonaws\.com/} # For geckodriver
  "https://selenium-release.storage.googleapis.com",
  "https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver"
]

If this is too broad (eg: You have other GitHub assets that you want to block), we can restrict the match by adding .+filename=geckodriver to the Regex above. Let me know if this works and I'll update the wiki.

from webdrivers.

kapoorlakshya avatar kapoorlakshya commented on September 13, 2024

Hi @pnikrat, thanks for this information. I have added it to the wiki - https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock

I have also added a link to the wiki in the README to let the users know it exists now.

from webdrivers.

mike1o1 avatar mike1o1 commented on September 13, 2024

Hi, I had the same issue with WebMock. The fix was similar:

allowed_sites = [
  "https://chromedriver.storage.googleapis.com",
  "https://github.com/mozilla/geckodriver/releases",
  "https://selenium-release.storage.googleapis.com",
  "https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver"
]

WebMock.disable_net_connect!(allow_localhost: true, allow: allowed_sites)

from webdrivers.

kapoorlakshya avatar kapoorlakshya commented on September 13, 2024

I appreciate you guys sharing this information! Updated the wiki page - https://github.com/titusfortner/webdrivers/wiki/Using-with-VCR-or-WebMock

from webdrivers.

lordofthedanse avatar lordofthedanse commented on September 13, 2024

@mike1o1 @kapoorlakshya I actually had to use a regex for geckodriver (a second request was being shot off for a tarball at an s3.AWS site). This is kind of a pain because WebMock (maddeningly) suggests stubbing the request to https://github.com/mozilla/geckodriver/releases, even after it is whitelisted (because of the second failure).

Unfortunately, the only term that’s shared between the two requests is gecko (AWS link below):

https://github-production-release-asset-2e65be.s3.amazonaws.com/25354393/2c0dc800-234f-11e9-8b9d-d8a1e36cb2c3?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A/20190430/us-east-1/s3/aws4_request&X-Amz-Date=20190430T132120Z&X-Amz-Expires=300&X-Amz-Signature=2769cf8c4d27aca791398c17e8673b6607312daed49bd9ec367921376dbdc739&X-Amz-SignedHeaders=host&actor_id=0&response-content-disposition=attachment%3B%20filename=geckodriver-v0.24.0-macos.tar.gz&response-content-type=application/octet-stream

so I would recommend amending the Wiki to suggest something like ...

allowed_sites = [
  "https://chromedriver.storage.googleapis.com",
  %r{/geckodriver/},
  "https://selenium-release.storage.googleapis.com",
  "https://developer.microsoft.com/en-us/microsoft-edge/tools/webdriver”
]

from webdrivers.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.