"Cross-Origin Request Blocked" #3

Closed
opened 2024-09-12 03:09:27 +02:00 by ali · 2 comments

Sorry, I was typing the title and my hand pressed the Enter suddenly...

Sorry, I was typing the title and my hand pressed the Enter suddenly...
ali changed title from Cross-Origin Request Blocked" to "Cross-Origin Request Blocked" 2024-09-12 03:09:49 +02:00
Author

So... the issue is that, I was trying to use this service in a simple webpage using fetch API in JS and I got "Cross-Origin Request Blocked" error. I read the readmes and docs but I couldn't find anything related to this, so I decided to submit an issue for it.

image

The webpage's code:

<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="UTF-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<title>wmip</title>
	</head>
	<body>
		<h1>"What's my IP?"</h1>
		<h2>Your IP is: <span id="IP"></span></h2>
		<script>
			fetch("https://myip.bsd.cafe")
				.then((respone) => respone.json())
				.then(
					(response) =>
						(document.getElementById("id").textContent = response.ip)
				);
		</script>
	</body>
</html>
So... the issue is that, I was trying to use this service in a simple webpage using fetch API in JS and I got "Cross-Origin Request Blocked" error. I read the readmes and docs but I couldn't find anything related to this, so I decided to submit an issue for it. ![image](/attachments/8e1cc068-dbbb-4581-ac98-f6518529e7e2) The webpage's code: ```html <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8" /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <title>wmip</title> </head> <body> <h1>"What's my IP?"</h1> <h2>Your IP is: <span id="IP"></span></h2> <script> fetch("https://myip.bsd.cafe") .then((respone) => respone.json()) .then( (response) => (document.getElementById("id").textContent = response.ip) ); </script> </body> </html> ```
Owner

Hi,
the service has its own webpage - https://myip.bsd.cafe - and the nginx configuration allows requests only for its own domain. It's not intended to be embedded inside other domains' webpages, but can be downloaded and self-hosted for any kind of purpose.

Hi, the service has its own webpage - https://myip.bsd.cafe - and the nginx configuration allows requests only for its own domain. It's not intended to be embedded inside other domains' webpages, but can be downloaded and self-hosted for any kind of purpose.
Sign in to join this conversation.
No labels
No milestone
No project
No assignees
2 participants
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference: BSDCafe/checkmyip#3
No description provided.