Skip to content

Create megastar #9421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed

Conversation

megastartravels
Copy link

Fixes #[insert GH or internal issue link(s)].

Describe your change...


  • Tests
    • TODO (before merge)
    • Tests included
    • Tests not necessary because:
  • Wrangler / Vite E2E Tests CI Job required? (Use "e2e" label or ask maintainer to run separately)
    • I don't know
    • Required
    • Not required because:
  • Public documentation
    • TODO (before merge)
    • Cloudflare docs PR(s):
    • Documentation not necessary because:
  • Wrangler V3 Backport
    • TODO (before merge)
    • Wrangler PR:
    • Not necessary because:

@megastartravels megastartravels requested review from a team as code owners June 1, 2025 05:10
Copy link

changeset-bot bot commented Jun 1, 2025

⚠️ No Changeset found

Latest commit: fe77412

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

Comment on lines +6 to +8
let url = new URL(request.url);
url.hostname = "mburley.dreamvacations.com"; // Target domain
let response = await fetch(url.toString(), request);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

When forwarding requests to another domain, you should create a new Request with updated headers rather than reusing the original request object. The current implementation might cause issues with headers like 'Host' that should match the target domain.

Suggested change
let url = new URL(request.url);
url.hostname = "mburley.dreamvacations.com"; // Target domain
let response = await fetch(url.toString(), request);
let url = new URL(request.url);
url.hostname = "mburley.dreamvacations.com"; // Target domain
let newRequest = new Request(url.toString(), {
method: request.method,
headers: request.headers,
body: request.body,
redirect: 'follow'
});
let response = await fetch(newRequest);

Comment on lines +1 to +10
addEventListener("fetch", event => {
event.respondWith(handleRequest(event.request));
});

async function handleRequest(request) {
let url = new URL(request.url);
url.hostname = "mburley.dreamvacations.com"; // Target domain
let response = await fetch(url.toString(), request);
return response;
}
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file appears to be a personal Worker script that proxies to a specific domain (mburley.dreamvacations.com) rather than a generic template or example that would be appropriate for the workers-sdk repository. Could you clarify the purpose of adding this file?

@@ -0,0 +1,10 @@
addEventListener("fetch", event => {
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This file is missing a file extension. If this is intended to be a JavaScript Worker script, it should have a .js extension.

@edmundhung edmundhung closed this Jun 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants