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

    Cronus

    05/05/2023, 5:48 PM
    Copy code
    export default {
      async fetch(request, env) {
        if (!authorizeRequest(request, env)) {
          return new Response('Forbidden', { status: 403 });
        }
        
        const body = await request.text();
        const requestingIP = String(request.headers.get('x-forwarded-for')) || String(request.headers.get('CF-Connecting-IP'));
        var parsedBody;
  • c

    Cronus

    05/05/2023, 5:48 PM
    new code above
  • k

    kian

    05/05/2023, 5:52 PM
    How are you uploading the Worker?
  • c

    Cronus

    05/05/2023, 5:52 PM
    What do you mean by uploading the worker?
  • n

    NodSaibot

    05/05/2023, 5:52 PM
    Just quick editing it in the browser
  • c

    Cronus

    05/05/2023, 5:53 PM
    oh how not why, my bad
  • c

    Cronus

    05/05/2023, 5:58 PM
    I was able to edit the code, and now NodSaibot can edit the code.
  • z

    zegevlier

    05/05/2023, 6:37 PM
    With that error it sounds like there is something wrong with a function above the
    export default
    . Perhaps you're missing a closing bracket somewhere there?
  • a

    Alisson Acioli

    05/05/2023, 6:44 PM
    Good afternoon, Is it possible to use MongoDB in Workers? Connect directly to the drive?
  • s

    ScuzzyHoulihan

    05/05/2023, 6:57 PM
    I found once I started usuing wrangler I did not run into these sort of problems. I recommend using wrangler over web editing.
  • n

    NodSaibot

    05/05/2023, 7:03 PM
    wasn't the case, whenever someone else adjusted with my code it worked. then it worked for me after it updated through them
  • n

    NodSaibot

    05/05/2023, 7:03 PM
    wasn't anything with the actual code itself
  • i

    IdkWhatever69

    05/05/2023, 10:06 PM
    any idea how i could get the filetype/extension of a file i fetched in workers?
  • d

    dave

    05/05/2023, 10:21 PM
    Did the behaviour of
    CF-Worker
    change? I thought it was always
    orgname.workers.dev
    . https://developers.cloudflare.com/fundamentals/get-started/reference/http-request-headers/#cf-worker
  • w

    Walshy | Pages

    05/05/2023, 10:22 PM
    it is
  • w

    Walshy | Pages

    05/05/2023, 10:22 PM
    what are you seeing?
  • d

    dave

    05/05/2023, 10:23 PM
    well the docs are claiming it can be
    foo.example.com
    if you own the domain
    example.com
  • w

    Walshy | Pages

    05/05/2023, 10:24 PM
    err yeah that's not right
  • w

    Walshy | Pages

    05/05/2023, 10:24 PM
    i'm not even sure how that would work
  • d

    dave

    05/05/2023, 10:24 PM
    same
  • w

    Walshy | Pages

    05/05/2023, 10:24 PM
    can you make a doc issue?
    d
    e
    • 3
    • 6
  • n

    Nyyrikki

    05/05/2023, 10:59 PM
    Hi - Small "bug" (i guess?) in Workers, when deploying a worker on a custom domain, it forces the creation of a new TLS certificate in Advanced Certificate Manager, even if there is already a wildcard covering the entire subdomain. Therefore leaks the endpoint to CT logs. If this additional certificate is deleted, the custom domain also gets deleted from the worker. Thanks
  • u

    Unsmart | Tech debt

    05/05/2023, 11:00 PM
    This is not a bug and is intentional
  • n

    Nyyrikki

    05/05/2023, 11:01 PM
    What is the reason behind this?
  • u

    Unsmart | Tech debt

    05/05/2023, 11:02 PM
    Not sure they have ever stated a reason officially for why
  • w

    Walshy | Pages

    05/05/2023, 11:03 PM
    i think it's just so we can support lower levels
  • w

    Walshy | Pages

    05/05/2023, 11:04 PM
    so abc.def.example.com
  • n

    Nyyrikki

    05/05/2023, 11:04 PM
    But what if I have a ACM custom cert for *.def.example.com and def.example.com already
  • w

    Walshy | Pages

    05/05/2023, 11:04 PM
    adding detections for all the different cert types and setups isn't trivial
  • w

    Walshy | Pages

    05/05/2023, 11:05 PM
    this is easy and straightforward
1...243924402441...2509Latest