Skip to content

x-forwarded-for, cf-connecting-ip, etc. causes failed signature #77

@timkelty

Description

@timkelty

In my Cloudflare worker, signing fails unless I remove these headers first:

		'cf-connecting-ip',
		'cf-ipcountry',
		'cf-ray',
		'x-forwarded-for',
		'x-real-ip',

In my case, I'm working around like this:

	// Signing will fail if these headers are present 🤷
	const unsignableHeaders = [
		'cf-connecting-ip',
		'cf-ipcountry',
		'cf-ray',
		'x-forwarded-for',
		'x-real-ip',
	];

	unsignableHeaders.forEach((name) => {
		console.log("Removing unsignable header", name);
		originRequest.headers.delete(name);
	});

	return aws.sign(originRequest);

Perhaps there should be an option to pass unsignableHeaders as an option?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions