Nangman02
Nangman02
NNuxt
Created by Nangman02 on 2/12/2025 in #❓・help
preflight with 204 no content
Hello everyone. Due to unfortunate downsizing, I must handle the project with 2 Vue clients. I have never done any client development before, but one seems to use Nuxt 2 (A), and the other uses Vite(B). They are used in mixed ways. However, (A) mostly serves users who are not signed in, and (B) serves users who are signed in with the app.domain. The production service is working fine, but I am trying to restore the dev server. Fortunately, as the codebase is structured with dockers, I at least succeeded in making them run. However, I am having a hard time calling backend APIs from the client apps. There is an API called with "https://api.localdomain/latest/user/login" It works fine when directly accessed with the browser or the cURL, which returns the correct headers. However, when I access it through the frontend app, the preflight fails with 204 no content, which includes a wildcard('*') for the access-control-allow-origin header, and the subsequent main request fails because of CORS failure. Other GET requests with the same /latest path from the client seem to get 200 fine. I reconstructed the preflight request, but it works perfectly independently, so it doesn't seem to be the backend problem. I am guessing something Nuxt-related is intercepting the request, but I just can't find what is actually happening. I don't have anywhere else to ask, so I am uploading this post. Please forgive me if I am asking a stupid question.
7 replies