OData / OData/AspNetCoreOData

Calling endpoint with $compute when Compute is not allowed in settings, still parses the whole expression

Open
#730 4 comments 1 reaction 1 assignee View on GitHub

@xuzhg is already working on this.

Since Nov 17, 2022.

  • #735 by @xuzhg — merged
bug followup
Dominant language
C#
Stars
505
Forks
186
PR merge metrics
No merged PRs in 30d

Description

Assemblies affected
ASP.NET Core OData 8.0.11

Describe the bug
I have an endpoint where I explicitly disallow all query options, but when I pass make a request using $compute, it still parses the expression.

Reproduce steps
Using the ODataRoutingSample:

  • On the PeopleController change the [EnableQuery] on the get to [EnableQuery(AllowedQueryOptions = AllowedQueryOptions.None)]

Request/Response

  • perform the request /people/$compute=test add p12m

Reponse tells me that the compute expression is invalid

Expected behavior
Expected the error "The query specified in the URI is not valid. Query option 'Compute' is not allowed."

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.