Closed luke- closed 1 year ago
More about headers explained here: https://github.com/luke-/app/issues/5#issuecomment-1403340044
@PrimozRatej Hmm, I would prefer to use HTTP headers to identify Mobile App requests from the web application side. This way we could easily change rendering (e.g. extra menu points, javascript channel addon).
Would be great if you could take a look into flutter_inappwebview if it appears to be stable & reliable and supports HTTP headers.
If such HTTP header approach leads to major difficulties, we can also start with cookies for app detection.
@PrimozRatej Maybe we can use a custom UserAgent
Header? https://stackoverflow.com/questions/73715018/how-to-add-custom-user-agent-to-flutter-webview
This was impl. in the scope of this #30 issue
Lucas commented I just tested the version 0.1.13 and could not see the header My-Custom-Header there. For testing, I have output all sent headers on the login page, below the login form.
But there is another header x-requested-with and value com.humhub.app. This seems to be a default header. If our custom header solution does not work, we could possibly fall back on this.
Best lucas
It should work now:
Is it possible to add an custom HTTP Header
HUMHUB-APP
on Requests made by the WebView Component?e.g. https://stackoverflow.com/questions/66850750/flutter-webviewcontroller-how-add-header https://stackoverflow.com/questions/61482001/flutter-webview-intercept-and-add-headers-to-all-requests
I would prefer that instead of only sending a cookie with the initial request.