Skip to content

Improve Cors logging message.#1378

Merged
brockallen merged 1 commit intomainfrom
anders/cors-error-message
Jul 19, 2023
Merged

Improve Cors logging message.#1378
brockallen merged 1 commit intomainfrom
anders/cors-error-message

Conversation

@AndersAbel
Copy link
Copy Markdown
Member

The previous wording looks like thee is an error. If this shows up in the log when troubleshooting, people starts looking at Cors even though it's probably something else

- The previous wording looks like there is an error. If this shows up
  in the log when troubleshooting, people starts looking at Cors even
  though it's probably something else
_logger.LogDebug("CORS request made for path: {path} from origin: {origin} but was ignored because path was not for an allowed IdentityServer CORS endpoint", path, origin);
_logger.LogDebug("IdentityServer CorsPolicyService didn't handle CORS request made for path: {path} from origin: {origin} " +
"because it is not for an IdentityServer CORS endpoint. To allow CORS requests to non IdentityServer endpoints, please " +
"set up your own Cors policy for your application by calling app.UseCors(\"MyPolicy\") in the pipeline setup.", path, origin);

Check failure

Code scanning / CodeQL

Log entries created from user input

This log entry depends on a [user-provided value](1).
_logger.LogDebug("CORS request made for path: {path} from origin: {origin} but was ignored because path was not for an allowed IdentityServer CORS endpoint", path, origin);
_logger.LogDebug("IdentityServer CorsPolicyService didn't handle CORS request made for path: {path} from origin: {origin} " +
"because it is not for an IdentityServer CORS endpoint. To allow CORS requests to non IdentityServer endpoints, please " +
"set up your own Cors policy for your application by calling app.UseCors(\"MyPolicy\") in the pipeline setup.", path, origin);

Check failure

Code scanning / CodeQL

Log entries created from user input

This log entry depends on a [user-provided value](1).
@brockallen brockallen merged commit 200d6d1 into main Jul 19, 2023
@brockallen brockallen deleted the anders/cors-error-message branch July 19, 2023 19:53
@josephdecock josephdecock added this to the 7.0.0 milestone Nov 13, 2023
@josephdecock josephdecock mentioned this pull request Nov 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants