md-y/mangadex-full-api

Getting "wrong response"

Closed this issue · 1 comments

Hi Sam, I found that i keep getting the "wrong response" mentioned in the mangadex api docs when I am using MFA.
image

I'm not sure what I'm doing wrong because I got the correct data using MFA but I keep getting the wrong response even though I have the URL path for images such as the cover url and chapter images url. It is mentioned in the docs that hotlinked is not allowed but then how can I use MFA if I keep getting the wrong response. How do you get around this with MFA?

md-y commented

The problem with the invalid response isn't a problem that can be solved by MFA. MFA simply provides a URL like this, and it is the job of the client (the browser, Discord, etc.) to request the image data itself.

I assume the reason the invalid response is appearing in your application is because you are directly using the provided URL in the browser, so it is appending the host/referrer HTTP header for a non-Mangadex domain. This means Mangadex blocks the request.

In order for the image data to actually be provided, you need to request the image data from the server side. There are many ways of doing this, but here is one example of how to do so with Node. You can then pass this data to the client. This is what the official API means by proxying your images to avoid hotlinking.

Hope this helps.