Already done that, I still have many workers on the old bundled but my default plan is the new Stand
Already done that, I still have many workers on the old bundled but my default plan is the new Standard, I'm not enterprise
ctx.otherService.fetch("/some/relative/path") that would call that service through an internal network. However, that seems not to be the case, I now have to bind the service, but also somehow configure the url of how to access that service.const authResponse = await env.auth.fetch(request.clone());Fetcher that a worker implements, but it is a bit confusing that you must pass a host, while in fact it is not used at all...new URL(req.url) doesn't break in Service Bindings/Durable Objects
Link element, tag: fn&Ī*k�<�ʣ Attribute translator - tag: z�
Link element, tag: l$¶x��t��Śfo�k[����ң☺�e��
Attribute translator - tag: l$¶x��t��Śfo�k[����ң☺�e��
Link element, tag: p��0�#|�♠���$�ӌ�◄§�-f}tda�"~w��+�?ͩ�f+k���m�y@�p��7��▲��
Attribute translator - tag: p��0�#|�♠���$�ӌ�◄§�-f}tda�"~w��+�?ͩ�f+k���m�y@�p��7��▲�� let rewriter = new HTMLRewriter().onDocument(new DocumentHandler(context))
.on("*", new LinkHandler(context))
.on("*", new AttributeTranslationHandler(context));
// Add element text translation handler for all elements that are allowed to be translated
for (let element of config.translation["translate-behaviour"]["allowed-tags"]) {
rewriter = rewriter.on(`[${element}]`, new AttributeTranslationHandler(context));
}
return rewriter.transform(fetchResult);class LinkHandler implements HTMLRewriterElementContentHandlers {
// Current URL
context: EventContext<any, any, any>;
currentURL: string;
constructor(context: EventContext<any, any, any>) {
this.context = context;
this.currentURL = context.request.url;
}
// Go through all attributes in the config (src, href, etc) and rewrite them to the correct URI
element(element: Element) {
// Show the element type and id
console.log(`Link element, tag: ${element.tagName}`);
// // Check if the element has any rewriteable attributes
for (let attribute of config["reverse-proxy"]["proxied-attributes"]) {
// Check if the element has the attribute
if (!element.getAttribute(attribute)) {
// Rewrite the attribute
continue;
}
// Check the current locale, and prepend it to the URL in the attribute
let currentLocale = getCurrentLocale(new URL(this.currentURL));
// If no current locale, then continue
if (!currentLocale) {
continue;
}
// Replace the "target-url" with "target-url"/currentLocale/
let new_attribute = element.getAttribute(attribute).replace(config["reverse-proxy"]["target-url"], `${config["reverse-proxy"]["target-url"]}/${currentLocale}`);
// If it's different, then log it and change it
if (new_attribute == element.getAttribute(attribute)) {
continue;
}
console.log("Changed attribute from " + element.getAttribute(attribute) + " to " + new_attribute + " for attribute " + attribute + " on element " + element.tagName);
element.setAttribute(attribute, new_attribute);
}
// Kma
}
}