Skip to content

Replace Non Standard IfMatch Header with Standard If-Match Header #747

@yulivee

Description

@yulivee

When working with the OData E-Tag, Restier expects the Header to contain IfMatch.

This Header actually contains a hyphen, according (see https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/If-Match).
Per RFC 7232 the Notation is also If-Match (see https://www.rfc-editor.org/rfc/rfc7232#section-3.1)

When working with E-Tags, we currently require a fix in our request pipeline to rewrite the header:

            // Fix IfMatch --> If-Match
            app.Use(async (context, next) =>
            {
                if (context.Request.Headers.IfMatch.Count > 0)
                {
                    context.Request.Headers.Add("IfMatch", context.Request.Headers.IfMatch.First());
                }

                await next();
            });

For Batch Requests we need an additional Batch-Interceptor to rewrite the header (which I am currently still working on)

Expected result

I expect ResTier to work with Standard HTTP Headers and not need a workaround for this

Actual result

Restier expects the Header in the Notation IfMatch

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions