I know this might be similar to many of the questions already asked, and I have been through almost all of them. But somehow, I am not able to fix the issue.
I have a Java back-end with Spring web, serving APIs to my angular application.
I have setup proxy for Java as well as Angular in Apache2, setup the tor configurations, and the both the onion urls work great.
However, the proble is with API response. The TOR Browser is blocking any type of API call from my Angular front-end with error :
OPTIONS : CORS Allow Origin Not Matching Origin
POST : NS_ERROR_DOM_BAD_URI
For GET request, I however see a 200 response but still it's blocked by TOR browser and no content is loaded on the screen.
POST / OPTIONS Request Headers in TOR Browser :
OPTIONS /coin/fees?get=true HTTP/1.1
Host: myonionUrlHere.onion
User-Agent: Mozilla/5.0 (Windows NT 10.0; rv:109.0) Gecko/20100101 Firefox/115.0
Accept: */*
Accept-Language: en-US,en;q=0.5
Accept-Encoding: gzip, deflate, br
Access-Control-Request-Method: POST
Access-Control-Request-Headers: content-type
Origin: null
Connection: keep-alive
Sec-Fetch-Dest: empty
Sec-Fetch-Mode: cors
Sec-Fetch-Site: cross-site
Pragma: no-cache
Cache-Control: no-cache
RESPONSE HEADERS :
HTTP/1.1 200
Vary: Origin
Vary: Access-Control-Request-Method
Vary: Access-Control-Request-Headers
Access-Control-Allow-Origin: null
Access-Control-Allow-Methods: GET,POST,PUT,DELETE,OPTIONS
Access-Control-Allow-Headers: content-type
Access-Control-Expose-Headers: Access-Control-Allow-Origin
Access-Control-Allow-Credentials: true
Access-Control-Max-Age: 1800
Allow: GET, HEAD, POST, PUT, DELETE, OPTIONS, PATCH
Content-Length: 0
Date: Sun, 28 Jan 2024 06:25:56 GMT