I have backend app written in java ee and jersey. When I posting data to my rest endpoint, using JavaScript Fetch API I see that the filter is fired twice. Once it haven't authorization header, second it have. When I try open my site from web browser then this filter is called only once. Why this happened. Maybe it's because of CORS?
below my logs from single post both printed from the same filter.
http://localhost:8080/BlogRest/controller/endpoint/|#]
Key=host, value=localhost:8080|#]
Key=origin, value=http://localhost:3000|#]
Key=access-control-request-method, value=POST|#]
Key=content-length, value=0|#]
Key=access-control-request-headers, value=authorization,content-type|#]
Key=connection, value=keep-alive|#]
Key=accept, value=*/*|#]
Key=user-agent, value=user agent data|#]
Key=referer, value=http://localhost:3000/|#]
Key=accept-language, value=pl-pl|#]
Key=accept-encoding, value=gzip, deflate|#]
second call
http://localhost:8080/BlogRest/controller/endpoint/|#]
Key=host, value=localhost:8080|#]
Key=origin, value=http://localhost:3000|#]
Key=content-type, value=application/json|#]
Key=accept-language, value=pl-pl|#]
Key=accept-encoding, value=gzip, deflate|#]
Key=connection, value=keep-alive|#]
Key=accept, value=*/*|#]
Key=user-agent, value=user agent data|#]
Key=authorization, value=Bearer token|#]
Key=referer, value=http://localhost:3000/origin|#]
Key=content-length, value=15|#]