web app on iOS webview continues flickering, reporting 404 app not found #12784

Closed
opened 2026-02-21 19:09:02 -05:00 by yindo · 2 comments
Owner

Originally created by @hbprotoss on GitHub (Apr 10, 2025).

Self Checks

  • This is only for bug report, if you would like to ask a question, please head to Discussions.
  • I have searched for existing issues search for existing issues, including closed ones.
  • I confirm that I am using English to submit this report (我已阅读并同意 Language Policy).
  • [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:)
  • Please do not modify this template :) and fill in all the required fields.

Dify version

1.0.3

Cloud or Self Hosted

Self Hosted (Docker)

Steps to reproduce

When loading the web app generated by chatflow in the iOS WebView, the page constantly flickers and refreshes, displaying the message "404 app not found." Upon inspecting the API calls, it was found that the /api/passport endpoint returns a 404 error due to the missing x-app-code header. This issue does not occur on PC and iOS safari browser

✔️ Expected Behavior

No response

Actual Behavior

No response

Originally created by @hbprotoss on GitHub (Apr 10, 2025). ### Self Checks - [x] This is only for bug report, if you would like to ask a question, please head to [Discussions](https://github.com/langgenius/dify/discussions/categories/general). - [x] I have searched for existing issues [search for existing issues](https://github.com/langgenius/dify/issues), including closed ones. - [x] I confirm that I am using English to submit this report (我已阅读并同意 [Language Policy](https://github.com/langgenius/dify/issues/1542)). - [x] [FOR CHINESE USERS] 请务必使用英文提交 Issue,否则会被关闭。谢谢!:) - [x] Please do not modify this template :) and fill in all the required fields. ### Dify version 1.0.3 ### Cloud or Self Hosted Self Hosted (Docker) ### Steps to reproduce When loading the web app generated by chatflow in the iOS WebView, the page constantly flickers and refreshes, displaying the message "404 app not found." Upon inspecting the API calls, it was found that the /api/passport endpoint returns a 404 error due to the missing x-app-code header. This issue does not occur on PC and iOS safari browser ### ✔️ Expected Behavior _No response_ ### ❌ Actual Behavior _No response_
yindo added the 🐞 bug label 2026-02-21 19:09:02 -05:00
yindo closed this issue 2026-02-21 19:09:02 -05:00
Author
Owner

@dosubot[bot] commented on GitHub (Apr 10, 2025):

Hello @hbprotoss! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together!

The issue you're experiencing with the web app flickering and displaying "404 app not found" in the iOS WebView is likely due to the iOS WebView not sending the required X-App-Code header in its requests. This header is necessary for the /api/passport endpoint to function correctly, as it checks for the presence of this header and raises an Unauthorized error if it is missing [1].

To resolve this, you need to ensure that the iOS WebView is configured to include the X-App-Code header in its HTTP requests. This might involve modifying the WebView setup in your iOS app to add custom headers to the requests. Unfortunately, specific instructions on how to configure the iOS WebView to include custom headers are not available in the Dify documentation, so you may need to refer to general iOS development resources or documentation for guidance on setting HTTP headers in WebView.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@dosubot[bot] commented on GitHub (Apr 10, 2025): <!-- Greeting --> Hello @hbprotoss! I'm [Dosu](https://dosu.dev), your friendly bot here to help you solve bugs, answer questions, and guide you on your journey as a contributor. I'm here while you wait for a human maintainer. Let's tackle this issue together! <!-- Answer --> The issue you're experiencing with the web app flickering and displaying "404 app not found" in the iOS WebView is likely due to the iOS WebView not sending the required `X-App-Code` header in its requests. This header is necessary for the `/api/passport` endpoint to function correctly, as it checks for the presence of this header and raises an `Unauthorized` error if it is missing <sup>[[1]](https://github.com/langgenius/dify/blob/main/api/controllers/web/passport.py)</sup>. To resolve this, you need to ensure that the iOS WebView is configured to include the `X-App-Code` header in its HTTP requests. This might involve modifying the WebView setup in your iOS app to add custom headers to the requests. Unfortunately, specific instructions on how to configure the iOS WebView to include custom headers are not available in the Dify documentation, so you may need to refer to general iOS development resources or documentation for guidance on setting HTTP headers in WebView. <!-- Dosu Comment Footer --> *To continue talking to [Dosu](https://dosu.dev), mention @dosu.* --- <sup>Help Dosu learn! Give it feedback: [Great Response](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=great_response) | [Irrelevant Answer](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=irrelevant_answer) | [Incorrect Sources](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=incorrect_sources) | [Too Verbose](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=too_verbose) | [Hallucination](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=hallucination) | [Bug Report](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=bug_report) | [Other](https://app.dosu.dev/response-feedback/823ca4b9-51a4-44ea-a69b-b1f92ac73664?feedback_type=other)</sup>
Author
Owner
@crazywoola commented on GitHub (Apr 12, 2025): https://stackoverflow.com/questions/25539837/how-to-add-customize-http-headers-in-uiwebview-request-my-uiwebview-is-based-on
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: langgenius/dify#12784