-
Notifications
You must be signed in to change notification settings - Fork 107
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
Добавлены свойства для чтения распространенных заголовков и методы работы с коллекцией #1426
Добавлены свойства для чтения распространенных заголовков и методы работы с коллекцией #1426
Conversation
…боты с коллекцией
WalkthroughThe Changes
Poem
Thank you for using CodeRabbit. We offer it for free to the OSS community and would appreciate your support in helping us grow. If you find it useful, would you consider giving us a shout-out on your favorite social media? TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (invoked as PR comments)
Additionally, you can add CodeRabbit Configuration File (
|
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.
[ContextProperty("AcceptEncoding", CanWrite = false)] | ||
public string AcceptEncoding | ||
{ | ||
get => _items.AcceptEncoding; | ||
set | ||
{ | ||
_items.AcceptEncoding = value; | ||
} |
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.
Inconsistent CanWrite
attribute for AcceptEncoding
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("AcceptEncoding", CanWrite = false)]
+ [ContextProperty("AcceptEncoding", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("AcceptEncoding", CanWrite = false)] | |
public string AcceptEncoding | |
{ | |
get => _items.AcceptEncoding; | |
set | |
{ | |
_items.AcceptEncoding = value; | |
} | |
[ContextProperty("AcceptEncoding", CanWrite = true)] | |
public string AcceptEncoding | |
{ | |
get => _items.AcceptEncoding; | |
set | |
{ | |
_items.AcceptEncoding = value; | |
} |
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.
@coderabbitai свойство CanWrite в атрибуте применяется для других целей и никак не связано с наличием сеттера у свойства. Это не ошибка.
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.
@EvilBeaver, спасибо за разъяснение. Я учту, что свойство CanWrite
в атрибуте ContextProperty
используется для других целей и не связано с наличием сеттера у свойства.
Learnings added
Learnt from: EvilBeaver
PR: EvilBeaver/OneScript#1426
File: src/OneScript.Web.Server/HeaderDictionaryWrapper.cs:43-50
Timestamp: 2024-07-25T09:44:11.733Z
Learning: The `CanWrite` attribute in the `ContextProperty` attribute is used for different purposes and is not related to the presence of a setter in the property.
Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.
[ContextProperty("ContentDisposition", CanWrite = false)] | ||
public string ContentDisposition | ||
{ | ||
get => _items.ContentDisposition; | ||
set | ||
{ | ||
_items.ContentDisposition = value; | ||
} |
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.
Inconsistent CanWrite
attribute for ContentDisposition
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("ContentDisposition", CanWrite = false)]
+ [ContextProperty("ContentDisposition", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("ContentDisposition", CanWrite = false)] | |
public string ContentDisposition | |
{ | |
get => _items.ContentDisposition; | |
set | |
{ | |
_items.ContentDisposition = value; | |
} | |
[ContextProperty("ContentDisposition", CanWrite = true)] | |
public string ContentDisposition | |
{ | |
get => _items.ContentDisposition; | |
set | |
{ | |
_items.ContentDisposition = value; | |
} |
[ContextProperty("AcceptRanges", CanWrite = false)] | ||
public string AcceptRanges | ||
{ | ||
get => _items.AcceptRanges; | ||
set | ||
{ | ||
_items.AcceptRanges = value; | ||
} |
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.
Inconsistent CanWrite
attribute for AcceptRanges
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("AcceptRanges", CanWrite = false)]
+ [ContextProperty("AcceptRanges", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("AcceptRanges", CanWrite = false)] | |
public string AcceptRanges | |
{ | |
get => _items.AcceptRanges; | |
set | |
{ | |
_items.AcceptRanges = value; | |
} | |
[ContextProperty("AcceptRanges", CanWrite = true)] | |
public string AcceptRanges | |
{ | |
get => _items.AcceptRanges; | |
set | |
{ | |
_items.AcceptRanges = value; | |
} |
[ContextProperty("Allow", CanWrite = false)] | ||
public string Allow | ||
{ | ||
get => _items.Allow; | ||
set | ||
{ | ||
_items.Allow = value; | ||
} |
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.
Inconsistent CanWrite
attribute for Allow
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("Allow", CanWrite = false)]
+ [ContextProperty("Allow", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("Allow", CanWrite = false)] | |
public string Allow | |
{ | |
get => _items.Allow; | |
set | |
{ | |
_items.Allow = value; | |
} | |
[ContextProperty("Allow", CanWrite = true)] | |
public string Allow | |
{ | |
get => _items.Allow; | |
set | |
{ | |
_items.Allow = value; | |
} |
[ContextProperty("AccessControlRequestHeaders", CanWrite = false)] | ||
public string AccessControlRequestHeaders | ||
{ | ||
get => _items.AccessControlRequestHeaders; | ||
set | ||
{ | ||
_items.AccessControlRequestHeaders = value; | ||
} |
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.
Inconsistent CanWrite
attribute for AccessControlRequestHeaders
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("AccessControlRequestHeaders", CanWrite = false)]
+ [ContextProperty("AccessControlRequestHeaders", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("AccessControlRequestHeaders", CanWrite = false)] | |
public string AccessControlRequestHeaders | |
{ | |
get => _items.AccessControlRequestHeaders; | |
set | |
{ | |
_items.AccessControlRequestHeaders = value; | |
} | |
[ContextProperty("AccessControlRequestHeaders", CanWrite = true)] | |
public string AccessControlRequestHeaders | |
{ | |
get => _items.AccessControlRequestHeaders; | |
set | |
{ | |
_items.AccessControlRequestHeaders = value; | |
} |
[ContextProperty("CacheControl", CanWrite = false)] | ||
public string CacheControl | ||
{ | ||
get => _items.CacheControl; | ||
set | ||
{ | ||
_items.CacheControl = value; | ||
} |
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.
Inconsistent CanWrite
attribute for CacheControl
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("CacheControl", CanWrite = false)]
+ [ContextProperty("CacheControl", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("CacheControl", CanWrite = false)] | |
public string CacheControl | |
{ | |
get => _items.CacheControl; | |
set | |
{ | |
_items.CacheControl = value; | |
} | |
[ContextProperty("CacheControl", CanWrite = true)] | |
public string CacheControl | |
{ | |
get => _items.CacheControl; | |
set | |
{ | |
_items.CacheControl = value; | |
} |
[ContextProperty("AccessControlAllowCredentials", CanWrite = false)] | ||
public string AccessControlAllowCredentials | ||
{ | ||
get => _items.AccessControlAllowCredentials; | ||
set | ||
{ | ||
_items.AccessControlAllowCredentials = value; | ||
} |
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.
Inconsistent CanWrite
attribute for AccessControlAllowCredentials
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("AccessControlAllowCredentials", CanWrite = false)]
+ [ContextProperty("AccessControlAllowCredentials", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("AccessControlAllowCredentials", CanWrite = false)] | |
public string AccessControlAllowCredentials | |
{ | |
get => _items.AccessControlAllowCredentials; | |
set | |
{ | |
_items.AccessControlAllowCredentials = value; | |
} | |
[ContextProperty("AccessControlAllowCredentials", CanWrite = true)] | |
public string AccessControlAllowCredentials | |
{ | |
get => _items.AccessControlAllowCredentials; | |
set | |
{ | |
_items.AccessControlAllowCredentials = value; | |
} |
[ContextProperty("Authorization", CanWrite = false)] | ||
public string Authorization | ||
{ | ||
get => _items.Authorization; | ||
set | ||
{ | ||
_items.Authorization = value; | ||
} |
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.
Inconsistent CanWrite
attribute for Authorization
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("Authorization", CanWrite = false)]
+ [ContextProperty("Authorization", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("Authorization", CanWrite = false)] | |
public string Authorization | |
{ | |
get => _items.Authorization; | |
set | |
{ | |
_items.Authorization = value; | |
} | |
[ContextProperty("Authorization", CanWrite = true)] | |
public string Authorization | |
{ | |
get => _items.Authorization; | |
set | |
{ | |
_items.Authorization = value; | |
} |
[ContextProperty("Age", CanWrite = false)] | ||
public string Age | ||
{ | ||
get => _items.Age; | ||
set | ||
{ | ||
_items.Age = value; | ||
} |
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.
Inconsistent CanWrite
attribute for Age
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("Age", CanWrite = false)]
+ [ContextProperty("Age", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("Age", CanWrite = false)] | |
public string Age | |
{ | |
get => _items.Age; | |
set | |
{ | |
_items.Age = value; | |
} | |
[ContextProperty("Age", CanWrite = true)] | |
public string Age | |
{ | |
get => _items.Age; | |
set | |
{ | |
_items.Age = value; | |
} |
[ContextProperty("Accept", CanWrite = false)] | ||
public string Accept | ||
{ | ||
get => BslStringValue.Create(_items[key.AsString()]); | ||
set => _items[key.AsString()] = value.AsString(); | ||
get => _items.Accept; | ||
set | ||
{ | ||
_items.Accept = value; | ||
} |
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.
Inconsistent CanWrite
attribute for Accept
property.
The CanWrite
attribute is set to false, but the property has a setter. This is inconsistent and should be corrected.
- [ContextProperty("Accept", CanWrite = false)]
+ [ContextProperty("Accept", CanWrite = true)]
Committable suggestion
‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.
[ContextProperty("Accept", CanWrite = false)] | |
public string Accept | |
{ | |
get => BslStringValue.Create(_items[key.AsString()]); | |
set => _items[key.AsString()] = value.AsString(); | |
get => _items.Accept; | |
set | |
{ | |
_items.Accept = value; | |
} | |
[ContextProperty("Accept", CanWrite = true)] | |
public string Accept | |
{ | |
get => _items.Accept; | |
set | |
{ | |
_items.Accept = value; | |
} |
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.
Actionable comments posted: 0
Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Files selected for processing (1)
- src/OneScript.Web.Server/HeaderDictionaryWrapper.cs (2 hunks)
Files skipped from review as they are similar to previous changes (1)
- src/OneScript.Web.Server/HeaderDictionaryWrapper.cs
Summary by CodeRabbit
New Features
Accept
,Authorization
).Retrieve
,Clear
,Delete
, and various append methods.Bug Fixes