-
Notifications
You must be signed in to change notification settings - Fork 2.5k
"*" origin and AllowCredentials shouldn't set together #18554
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Seems we need to add another check if the Cors set from |
|
FYI the current implementation shows
but still accepts the input and the exception throws in the next request |
|
@rjpowers10 could please confirm |
|
Please see #18552 (comment). |
Which feature do you refer to? |
Piedone
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This displays a warning when the offending configuration is saved, but saves the values. Instead, it should add a validation error and prevent saving the value in the first place.
src/OrchardCore.Modules/OrchardCore.Cors/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
…roller.cs Co-authored-by: Zoltán Lehóczky <[email protected]>
|
@rjpowers10 please comment on the PR |
|
I added a few minor comments but the validation change is what I was expecting. |
|
Did you submit your comments? Because nothing appears for me here. |
src/OrchardCore.Modules/OrchardCore.Cors/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Cors/Controllers/AdminController.cs
Outdated
Show resolved
Hide resolved
|
Is there anything else to add here, or shall we merge this? |
|
I'd appreciate if before these questions you'd please take a look at what the reviewer has written; it's a recurring theme that I come back with links to my prior comments. Because no, we shouldn't merge this until you address my comment here: #18554 (review). Please take a look. |
|
I got an approval from @rjpowers10; moreover, there's a reason that prevents me from achieving this easily, because the UI is controlled at the client-side. Let me revise this PR again |
|
@Piedone, as I said, the form relies on client-side, also the policies are not preserved until You could give it a try |
|
Well, then something needs to change because this is really confusing UX. BTW the wrong configuration is the default when you add a new policy. Please also remove that footgun. |
|
I just noticed: OrchardCore/src/OrchardCore.Modules/OrchardCore.Cors/Services/CorsOptionsConfiguration.cs Lines 28 to 32 in 8bac37a
Apparently, this isn't working well enough. This is what needs to be fixed. |
That's why I show the warning on the UI to let the user know there's something that needs attention
Did you mean to check if there's a wrong configuration in the |
Saving (seemingly) the policy while showing a warning that it's wrong and you shouldn't do that is confusing UX.
Add a policy, leave everything on default, Save, notice warning. The defaults are wrong. |

Fixes #18552