-
-
Notifications
You must be signed in to change notification settings - Fork 349
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
Bug: Processing for header field HTTP_X_REQUESTED_WITH is not enabled. #673
Comments
Additional info: To be added in function: |
For now you can enable it yourself when initializing your server |
OK, but please add the statement when a new version is released. |
I wonder if it is necessary to keep it enabled as default, or if we document that in order to use this, the user of Sming should enable it. The reason for asking is, that defaultwise we do not need this header and for most applications it is just wasted memory to always process it |
You could document it in the isAjax() function. (This is the minimal to avoid that people have to search why it "does not work".) |
@patrickjahns @yunjova Sorry for the late response. |
I`d prefer the current implementation over enabling every header by default. Sometimes the Webbrowser / Clients send a lot of not needed header information which would be kept in memory with every request. So depending on the request - the amount of memory available to actually processing the required headers/body decreases unnecessarily. If someone is interested in a particular header in his application he can enable processing.
|
@patrickjahns : |
@hreintke I like the idea with |
@patrickjahns : |
@hreintke
My fear is, that while ALL can be easily done by setting an internal boolean var - having a CONTAINS would make parsing more complex. i.e. does contains match STRING or does it match STRING* or *STRING ? Also not sure how the interface towards the application should be - will we allow processing of several checks (i.e. contains X-APP contains X-AUTH etc.) |
@patrickjahns : Reason to give the application some more flexibility and not requiring a (lot of) detailed hardcoding or high memory usage. Interface can be identical as we have now : And adding the check within : |
Thanks for clarification - I can create a PR with:
(since I am quite familiar with the HttpServer part anyhow) |
@patrickjahns : @yunjova :
|
With the latest Http refactoring (#1112) that issue should not longer be relevant. |
There is a bug in the file: "
Sming/Sming/SmingCore/Network/HttpServer.cpp
":Please add the statement:
enableHeaderProcessing("HTTP_X_REQUESTED_WITH");
This is needed to make the function
bool HttpRequest::isAjax()
inSming/Sming/SmingCore/Network/HttpRequest.cpp
work as is expected.The text was updated successfully, but these errors were encountered: