简体   繁体   English

Chrome 为 manifest.json 提供 401 错误

[英]Chrome gives a 401 error for manifest.json

I have a Flutter UI (Web channel) app that is deployed as a bundled Spring-boot app ( build files dropped into the main/resources folder in the Spring-boot project).我有一个 Flutter UI(Web 频道)应用程序,它部署为捆绑的 Spring-boot 应用程序(构建文件放入 Spring-boot 项目的 main/resources 文件夹中)。 The issue I'm facing is that every time I load the app in Chrome and login I see a 401 error pointing to the manifest.json.我面临的问题是,每次我在 Chrome 中加载应用程序并登录时,我都会看到指向 manifest.json 的 401 错误。 I don't face the same issue when I test my UI locally using Android Studio.当我使用 Android Studio 在本地测试我的 UI 时,我没有遇到同样的问题。 This setup uses a modified version of the spring-boot app that is running in Docker.此设置使用在 Docker 中运行的 spring-boot 应用程序的修改版本。

My manifest.json file is :我的 manifest.json 文件是:

{
    "name": "ccccc",
    "short_name": "ccccc",
    "start_url": "/#/",
    "display": "standalone",
    "background_color": "#0175C2",
    "theme_color": "#0175C2",
    "description": "basicapp",
    "orientation": "landscape-primary",
    "prefer_related_applications": false,
    "icons": [
        {
            "src": "icons/cd-16.png",
            "sizes": "16x16",
            "type": "image/png"
        },
        {
            "src": "icons/cd-32png",
            "sizes": "32x32",
            "type": "image/png"
        },
        {
            "src": "icons/cd-64.png",
            "sizes": "64x64",
            "type": "image/png"
        },
        {
            "src": "icons/cd-256.png",
            "sizes": "256x256",
            "type": "image/png"
        }
    ] }

And the error that I see is :我看到的错误是:

{"timestamp":"2021-09-30T18:34:24.329+00:00","status":401,"error":"Unauthorized","message":"","path":"/manifest.json"}

I thought this problem was similar to this but that fix did not work.我认为这个问题与类似,但该修复程序不起作用。 I then removed the reference to manifest.json from my index.html i e.然后我从我的 index.html 中删除了对 manifest.json 的引用,即。 <link rel="manifest" href="manifest.json"> and that got rid of the error but not sure if that is the right thing to do. <link rel="manifest" href="manifest.json">消除了错误,但不确定这是否正确。

Not sure what the issue is here, it does not stop me from logging into the app but it's just an annoyance to see that as the first thing in the console log.不确定这里的问题是什么,它并没有阻止我登录应用程序,但看到它作为控制台日志中的第一件事只是一种烦恼。 Any help/assistance to fix this is greatly appreciated.非常感谢任何解决此问题的帮助/协助。

You should try this solution where <link> must use crossorigin="use-credentials" tag.您应该尝试 解决方案,其中<link>必须使用crossorigin="use-credentials"标记。 I was having the same problem that you and this solved it.我遇到了和你一样的问题,这解决了它。 Hope you too!希望你也是!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 SpringSecurity提供了错误401错误的凭据 - SpringSecurity gives error 401 Bad Credentials Spring boot basic auth总是给出401错误 - Spring boot basic auth always gives 401 error 带有 basicauth 的 Ajax CORS 请求在浏览器上出现 401 错误 - Ajax CORS request with basicauth gives 401 error on browser Spring 到 Spring 引导转换 - tomcat 已启动,但命中端点会出现 401 错误“此应用程序没有明确的映射 / 错误, - Spring to Spring boot conversion - tomcat is up but hitting endpoint gives 401 Error "This application has no explicit mapping for / error, Spring Boot 安全性 - Postman 提供 401 Unauthorized - Spring Boot Security - Postman gives 401 Unauthorized Spring 安全中的 401 未经授权的错误 - 401 Unauthorized Error in Spring Security Azure AD OAuth 集成在 Sprint Boot 中会导致 401 Unauthorized - Azure AD OAuth integration in Sprint Boot gives 401 Unauthorized SpringBoot Rest Controller Integration测试始终会给401未经授权 - SpringBoot Rest Controller Integration test always gives 401 unauthorized Put 请求在 Spring Web 中给出错误 401/403 - Put request gives Errors 401/403 in Spring Web Spring 引导 gradle 项目部署到 heroku 使用 bitbucket 管道给出错误没有主要清单属性,在 build/libs/app-SNAPSHOT-plain.jar - Spring boot gradle project deployed to heroku using bitbucket pipeline gives error no main manifest attribute, in build/libs/app-SNAPSHOT-plain.jar
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM