-
Notifications
You must be signed in to change notification settings - Fork 122
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
Problem with finding some headers #491
Comments
What webserver are you using? I would be greatfull if you could post your debug-info (see documentation), it will help me debug the error and contains vital information about your webserver and it's header format. |
Hi, thanks for reply. As I mentioned before, I test
The code to detect headers was not optimized but I fix it with mentioned code above and it's ok now. Also because it'll regenerate csrf token each time after detection, if you send some ajax requests, it'll have problem. As I can see you are going to create new version. If you can fix some issues that I had and some features, it would be great:
SimpleRouter::get('/some-route', [SomeController::class, 'someMethod']);
<form method="post" action="<?= url('somewhere')->getRelativeUrl(); ?>">
<input type="text" name="test">
<button type="submit">submit</button>
</form> It does not work because
// if I use this
$val = input()->post('some_value', null);
// then I must check it through null like
if(null !== $val) {
echo $val->getValue();
}
// but if I don't want the value and just want the check
if('x' == input()->post('some_value', null)->getValue()) {
echo $val->getValue();
}
// as you can see `getValue()` method can not be apply to `null`
// if all values be an `InputItem` object, it would be much easier to use Thanks for your attention |
Hi again. Thanks for the feedback and the detailed explanation, I really appreciate it! From what you are describing it sounds like the browser and/or ajax is adding some additional naming to the header. I will do some testing and try to add support for better header parsing; it seems like webservers and browsers all have their own ways of specifying the headers. Great ideas! I will fix the url bugs right away and try to add class hinting feature to the upcoming release. / Simon |
I cannot recreate the I've tried routes like |
[FEATURE] Added support for class hinting on routes as requested by #491
This issue has been resolved in version 4.3.0.0. |
Inside
Request
class and insideconstruct
method you have following code that behave wrong (at least for me!)I replace this with below code to have some headers like
X-CSRF-TOKEN
that was not recognizable beforeThe text was updated successfully, but these errors were encountered: