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

    sathoro

    02/22/2023, 3:06 PM
    I suppose that could work, I am not that familiar with ipv6. so if it is shorter than 39 does that mean it is a less specific address essentially?
  • s

    sathoro

    02/22/2023, 3:06 PM
    yeah I'm just not sure exactly what the shorter addresses actually represent
  • s

    sathoro

    02/22/2023, 3:07 PM
    like is it actually possible that header would ever be something like
    ::100
    and what does that actually represent?
  • k

    kian

    02/22/2023, 3:08 PM
    you can omit
    0000
    sections
  • s

    sathoro

    02/22/2023, 3:08 PM
    I figured Cloudlare would normalize them or something to a full ipv6
  • s

    sathoro

    02/22/2023, 3:11 PM
    so... if it contains
    :
    but is less than 39 length then I should expand it to the full format first then take the substring?
  • s

    sathoro

    02/22/2023, 3:12 PM
    can anyone confirm Cloudflare doesn't expand them already? I haven't seen any short ones in my logs
  • h

    HardAtWork

    02/22/2023, 3:12 PM
    Would probably be easiest to just parse it in place. But that requires you to understand how the compression works.
  • h

    HardAtWork

    02/22/2023, 3:12 PM
    I've seen a few compressed ones, so as far as I'm aware, CF just passes them along as is.
  • s

    sathoro

    02/22/2023, 3:13 PM
    okay ty, I will check for a library to handle this. I thought my simple approach might be enough lol
  • s

    sathoro

    02/22/2023, 3:14 PM
    đź‘€
  • v

    vasco-santos

    02/22/2023, 3:58 PM
    Hey workers team, We submitted a while ago request to get sub-requests limit increased in our account. The use case where we hit this limit quite easily is a lot of requests from worker to R2 buckets. We did not get any answer on this form submission so far. Is there other suggestion route to go? From technical standpoint, it would be rad if we could simply get no sub-requests being accounted for interactions with workers bindings like R2 buckets.
  • k

    kian

    02/22/2023, 4:03 PM
    R2 buckets are already counted towards the inhouse limit of 1,000 per request
  • k

    kian

    02/22/2023, 4:03 PM
    Are you hitting that limit?
  • v

    vasco-santos

    02/22/2023, 4:38 PM
    Yes, we can easily hit 1000 limit for bigger files if R2 interactions count as sub-requests
  • k

    kian

    02/22/2023, 4:39 PM
    In a single request?
  • k

    kian

    02/22/2023, 4:39 PM
    Where did you submit the limit increase anyhow
  • v

    vasco-santos

    02/22/2023, 4:47 PM
    yes in same request. Limit increase form you can see after table in https://developers.cloudflare.com/workers/platform/limits/#account-plan-limits
  • v

    vasco-santos

    02/22/2023, 4:49 PM
    @kian to better describe use case we have, we are building on top of IPFS, and we have a content routing blockstore backed by R2. In other words, we receive user data uploads from our users in a format of blocks of chunked data during their uploads. On the reads, we need to reconstruct the graph of the data they previously uploaded to serve it as the complete file
  • v

    Vonarian

    02/22/2023, 5:59 PM
    Hi. Workers are my love. Bye.
  • d

    dave

    02/22/2023, 6:48 PM
    Is there better docs for using HTMLWriter with TypeScript? https://developers.cloudflare.com/workers/runtime-apis/html-rewriter/
  • k

    kian

    02/22/2023, 6:48 PM
    Nope but there isn't a whole lot to it either
  • d

    dave

    02/22/2023, 6:55 PM
    so this is what I have atm:
    Copy code
    typescript
                class ElementHandler {
                    element(element: { tagName: any }) {
                        console.log(`Incoming element: ${element.tagName}`);
                    }
                }
                  
    
                const rewriter = new HTMLRewriter().on('script', new ElementHandler())
                const amp_content_value_rewritten = await rewriter.transform(new Response(amp_content.value.toString()));
    
                console.debug(await amp_content_value_rewritten.text());
  • d

    dave

    02/22/2023, 6:55 PM
    Is there an existing class I can use for for
    element
    function, so I don't have to define each property myself?
  • k

    kian

    02/22/2023, 6:56 PM
    element: Element
  • d

    dave

    02/22/2023, 6:56 PM
    well then
  • d

    dave

    02/22/2023, 6:56 PM
    thank you
  • d

    dave

    02/22/2023, 6:56 PM
    that was way easier of an answer than I expected
  • k

    kian

    02/22/2023, 6:56 PM
    Haha
  • k

    kian

    02/22/2023, 6:57 PM
    Copy code
    ts
    declare interface HTMLRewriterElementContentHandlers {
      element?(element: Element): void | Promise<void>;
      comments?(comment: Comment): void | Promise<void>;
      text?(element: Text): void | Promise<void>;
    }
1...229822992300...2509Latest