Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Header hyphens vs. underscores #218

@g105b

Description

@g105b

When dealing directly with the Request object, hyphenated headers are converted to underscores, which is incorrect.

See:

$request = $this->container->get(Request::class);
$pagination = null;
if($request->hasHeader("x_pagination")) {
	$pagination = $request->getHeaderLine("x_pagination");
}

The actual header name is x-pagination, as per this JavaScript:

fetch(location.href, {
	headers: {
		"x-pagination": page
	}
}).then(response => {
	// ...
});

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions