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

    Advany

    03/27/2023, 1:23 PM
    I have. It workes with the set-cookie-parser. Can I dm it?
  • k

    kian

    03/27/2023, 1:29 PM
    Sure
  • s

    Skye

    03/27/2023, 1:38 PM
    isn't there a compat date or compat flag that affects cookie parsing 🤔
  • k

    kian

    03/27/2023, 1:42 PM
    indeed
  • k

    kian

    03/27/2023, 1:42 PM
    except that on/off doesn't fix this one
  • k

    kian

    03/27/2023, 1:42 PM
    so it might be a regression
  • k

    kian

    03/27/2023, 1:42 PM
    i'll test it w/ an old workerd release
  • w

    Walshy | Pages

    03/27/2023, 1:53 PM
    getting Set-Cookie has always been funky
  • w

    Walshy | Pages

    03/27/2023, 1:53 PM
    it's why getSetCookie exists
  • k

    kian

    03/27/2023, 1:56 PM
    ahhh, I see
  • k

    kian

    03/27/2023, 1:58 PM
    @Advany that cookie string you sent seems to work fine for me right now
  • k

    kian

    03/27/2023, 1:58 PM
    Do you have a Worker that reproduces it?
  • a

    Advany

    03/27/2023, 2:01 PM
    Let me create a test setup
  • a

    Advany

    03/27/2023, 2:11 PM
    Mhhh... can seem to replicate it 🙂 Maybe bug is somewere else in my code
  • a

    Advany

    03/27/2023, 2:11 PM
    Thanks for helping!
  • r

    renzor

    03/27/2023, 2:32 PM
    anyone know how to parse the contents of an email worker payload? I have this but it logs out what looks like a buffer
    Copy code
    export function parseTextStream(
      stream: ReadableStream,
    ): Promise<{ contentLength: number; text: string }> {
      let metadata = {
        text: "",
        contentLength: 0,
      }
    
      return new Promise((resolve) => {
        const reader = stream.getReader()
    
        reader.read().then(function processText({ done, value }) {
          if (done) {
            return resolve(metadata)
          }
    
          metadata.text += value.toString()
          metadata.contentLength += value.length
    
          return reader.read().then(processText)
        })
      })
    }
    Copy code
    const result = await parseTextStream(message.raw)
    console.log(`email`, result)
    // email {
    //  text: '82,101,99,101,105,...'
    //
    // }
  • k

    kian

    03/27/2023, 2:34 PM
    Take a look at https://github.com/edevil/email_worker_parser/blob/main/src/index.js
  • a

    anurag

    03/27/2023, 4:36 PM
    How do I add a team member to only Cloudflare workers?
  • e

    Erisa | Support Engineer

    03/27/2023, 4:38 PM
    - Go to https://dash.cloudflare.com/?to=/:account/members - Click the blue
    Invite
    button at the top - Enter their email - Set "Type" to "All domains" - Tick the "Cloudflare Workers Admin" role - Submit
  • a

    anurag

    03/27/2023, 4:38 PM
    but I don't want them to access all domains, I only want to give access to one 😄
  • e

    Erisa | Support Engineer

    03/27/2023, 4:39 PM
    Workers is an account scoped product (which comes under ""All domains" even though the Workers Admin role doesnt give any domain level access) - I dont think you can combine the account and domain scoped roles currently
  • a

    anurag

    03/27/2023, 4:40 PM
    let me give it a try with my other email. Thank you
  • e

    Erisa | Support Engineer

    03/27/2023, 4:40 PM
    Yeah for sure, give it a shot with a test user and see what you can do 🙂
  • a

    anurag

    03/27/2023, 4:42 PM
    Sure, Also, I disallow accesss to a specific worker? Since it's very easy to publish, I don't want my team members to accidentally publish to prod
  • e

    Erisa | Support Engineer

    03/27/2023, 4:42 PM
    Unfortunately not possible to scope by worker, sorry
  • a

    anurag

    03/27/2023, 4:47 PM
    I invited my other account with Worker Admin Priv, but I don't see my existing workers there! :/ It's asking me to create a new worker
  • e

    Erisa | Support Engineer

    03/27/2023, 4:48 PM
    Are you looking at the right account? There should be a list with multiple available on the invited user - also note that you have to go to your email and accept the invite first
  • a

    anurag

    03/27/2023, 4:52 PM
    My bad, I signed up with the new account. I thought I joined the org. There comes a red strip at the bottom with "Authentication Error" and the user is able to see all of my domains,
  • e

    Erisa | Support Engineer

    03/27/2023, 4:52 PM
    (This is why I call them users instead of accounts, a user can be members of multiple accounts even though they start with one)
  • e

    Erisa | Support Engineer

    03/27/2023, 4:53 PM
    If they click the domain does anything appear on it?
1...236023612362...2509Latest