https://discord.cloudflare.com logo
Join Discord
Powered by
# workers-discussions
  • w

    Walshy | Pages

    02/02/2021, 6:11 PM
  • d

    Deleted User

    02/02/2021, 6:11 PM
    Sure - but what benefits accrue besides replacing HTML content? Cause you don't own the full request - response cycle - so you lose the caching benefit of being able to lookup the cache object - you rely on waiting for a normal response to happen before you can modify it?
  • d

    Deleted User

    02/02/2021, 6:12 PM
    It's great for sub-requests and replacing content in HTML
  • d

    Deleted User

    02/02/2021, 6:13 PM
    Like - example case, taking a login page and adding CSRF tokens to it dynamically as well as a signed CSRF token to validate against but that actually would be done against one URL
  • d

    Deleted User

    02/02/2021, 6:16 PM
    Maybe CSP nonces
  • j

    JustinNoel

    02/02/2021, 6:36 PM
    Anyone know if Workers Routes override Page Rules for a domain? For example, I have this Page Rule that redirects my domain somewhere else:
    mydomain.com/* Forwarding URL (Status Code: 301 - Permanent Redirect, Url: https://myotherdomain.com)
    However, I also have a Worker Route that I want to use:
    mydomain.com/abc123/
    . However, every time I go to
    mydomain.com/abc123/
    , I'm redirected. Any way around this?
  • d

    Deleted User

    02/02/2021, 6:43 PM
    Did you enable the worker route - cause it seems odd the worker route is not dispatched before the Page Rule?
  • d

    Deleted User

    02/02/2021, 6:44 PM
    https://community.cloudflare.com/t/how-do-workers-combine-with-page-rules/20830
  • d

    Deleted User

    02/02/2021, 6:44 PM
    It seems it depends on what type of Page Rule it is..
  • n

    naveed

    02/02/2021, 9:57 PM
    does event.passThroughOnException counts towards the 100k daily limit? eg. using Router() class for static assets if we return event.passThroughOnException, will it count as a request? as per the doc, it says "with Fail open, Incoming requests will behave as if there was no Worker."
  • c

    Ceru ©

    02/02/2021, 10:09 PM
    i mean
  • c

    Ceru ©

    02/02/2021, 10:09 PM
    it wouldnt make sense for it to not count
  • c

    Ceru ©

    02/02/2021, 10:09 PM
    because you are still executing the worker
  • c

    Ceru ©

    02/02/2021, 10:09 PM
    but if theres an error, it will send the request to the origin
  • n

    naveed

    02/02/2021, 10:28 PM
    Yeah. thanks.. wish there was a better way to exclude static assets from these limits.
  • j

    JustinNoel

    02/03/2021, 5:52 AM
    Thanks for this. Unfortunately, it did not help 😢. Fortunately, I did a Hail Mary Pass and purged the cache for the redirected domain and it worked 💥🎉 .
  • d

    Deleted User

    02/03/2021, 1:14 PM
    Anybody using Cloudflare Workers as a way to detect non-human API activity and block? We looked at the Bot Management, but it's expensive - it would double our monthly Enterprise bill. I was thinking of hashing Colo, ASN, User Agent, IP Address and then having it check an automatically generated blacklist (which we run in a cronjob every minute using heuristics like how many searches and how related are the search terms) we would keep on an endpoint and cache at the edge for 30 seconds or so and if they match - block the request. Any better ideas? We could also use Cloudflare Firewall - but this kind of feels better for temporary blocks..
  • d

    Deleted User

    02/03/2021, 1:22 PM
    Without having to issue a custom token or a Cookie - is there a way other than hashing what CF gives us - to tell separate clients apart? I imagine it's a privacy issue..
  • g

    Greg Brimble | Cloudflare Pages

    02/03/2021, 1:41 PM
    Kind of depends on your goals here. Are you trying to stop attackers, or are you trying to simply identify humans?
  • g

    Greg Brimble | Cloudflare Pages

    02/03/2021, 1:42 PM
    If you control the client, you could simply inject a header or something. No (unprejudiced) bot will send you that custom header, but an attacker absolutely might.
  • c

    CodeCo

    02/03/2021, 1:50 PM
    @Deleted User reCAPTCHA v3 might fit your needs
  • p

    Peps

    02/03/2021, 2:05 PM
    recaptcha also requires you to pay for usage after a certain amount
  • p

    Peps

    02/03/2021, 2:05 PM
    it's one of the big reasons why Cloudflare moved away from it
  • p

    Peps

    02/03/2021, 2:05 PM
    believe it was $1 per 1000
  • p

    Peps

    02/03/2021, 2:06 PM
  • g

    Greg Brimble | Cloudflare Pages

    02/03/2021, 2:09 PM
    hCaptcha is a great free alternative (https://www.hcaptcha.com/). It's what Cloudflare switched to, and I wrote a little package to integrate with it here: https://www.npmjs.com/package/@glenstack/cf-workers-hcaptcha
  • d

    Deleted User

    02/03/2021, 2:10 PM
    Thanks - will have a look
  • c

    cameron

    02/03/2021, 3:42 PM
    As someone who tried doing this with lambda at edge, I would recommend just moving to their bot management. we spent so much time and effort trying to build out our own custom solution but it didn't work that well and was way too much hassle. think of all of the time of building + maintaining vs the cost now where I barely think about it. with bot management, you benefit from scale, so cloudflare seeing lots more traffic make it easier to determine bots vs just your domains. not trying to shill, just sharing my experience 😂 . since you're on enterprise I'd recommend asking for a demo, its pretty interesting to see how it all works
  • d

    Deleted User

    02/03/2021, 3:45 PM
    You see - now you using logic and I agree with you. Convincing my bosses to put it into a budget = never going to happen. I'm thinking of doing a simple approach first to this and just cover our most computationally intensive route. 🙂
  • c

    cameron

    02/03/2021, 3:47 PM
    yeah unfortunately we had to the same thing initially. just be sure to log all the time you've spent on it and the continual time and incidents. sooner or later the cost of it will come out and hopefully encourage a switch. don't be afraid to be loud about it too "the squeaky wheel gets the grease"
1...818283...2509Latest