Skip to content

Handle type mismatches in NEL header more gracefully #85

@dcreager

Description

@dcreager
Member

Right now the spec says that if you provide the wrong type of value for any of the fields in a NEL policy (e.g., a string for success_fraction), we ignore the entire policy. For fields that have a default value, @igrigorik suggested a more graceful solution would be to use the default value instead.

Activity

yoavweiss

yoavweiss commented on Jul 19, 2018

@yoavweiss
Contributor

How will the developer know about their misconfiguration? Seems like 0 entries will be more noticeable than entries with different characteristics

dcreager

dcreager commented on Jul 19, 2018

@dcreager
MemberAuthor

There isn't a mechanism to send this information back to the server; you'd have to rely on the developer who's trying to add the policy headers to test it out locally. For that, the Chrome implementation has a tab under chrome://net-internals that shows you all of the policies that have been received. I can make sure that shows the policy after parsing (and applying of default values). We can also hook something up in the net log that would print out more detailed error messages about invalid policy headers.

I think that will work regardless of whether or not we go for this more lenient handling of type mismatches.

added
backwards-compatible*Shouldn't* require any backwards-incompatible changes to the header or payload formats
on Jul 19, 2018
nicjansma

nicjansma commented on May 9, 2025

@nicjansma

Couldn't this just be a developer tools warning?

Alternatively, via Reporting API, some sort of 'misconfiguration' report?

clelland

clelland commented on May 9, 2025

@clelland
Contributor

DevTools makes sense - Chrome at least has an "issues" tab in DevTools now (that would be implementation-specific, I think. I don't think we'd spec it)

I'd be concerned about using the reporting API to report on essentially itself :) It might be too easy for a misconfiguration to result in a huge flood of traffic, possibly directed to the wrong server

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    backwards-compatible*Shouldn't* require any backwards-incompatible changes to the header or payload formats

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @dcreager@clelland@yoavweiss@nicjansma

        Issue actions

          Handle type mismatches in NEL header more gracefully · Issue #85 · w3c/network-error-logging