Closed Bug 1701868 Opened 3 years ago Closed 3 years ago

Support opaque response blocking when content type is recognized in OnDataAvailable()

Categories

(Core :: DOM: Networking, task, P1)

task

Tracking

()

RESOLVED FIXED
90 Branch
Tracking Status
firefox90 --- fixed

People

(Reporter: edenchuang, Assigned: edenchuang)

References

(Blocks 1 open bug)

Details

(Whiteboard: [necko-triaged])

Attachments

(2 files)

Opaque Response Blocking logic executes when a channel is OnStartRequest stage.
However, it might have enough data/information to recognize the actual content type. And the logic can be passed as followings types
Allowed_UnexpectedResponseHead
Allowed_FailtoGetMIMEType
Allowed_NotImplementOrPass

But the content type could be recognized during OnDataAvailable stage by sniffing with UnknownDecoder. The opaque response blocking should execute again when the actual content type is recognized.

Assignee: nobody → echuang
Blocks: orb
Status: NEW → ASSIGNED
Severity: -- → S3
Priority: -- → P1
Whiteboard: [necko-triaged]

The original implementation concept of Opaque Response Blocking is trying to recognize the blocked or allowed content type in nsHttpChannel::CallOnStartRequest. However, the data could be not available at the moment for type sniffing. And nsUnknownDecoder could be used for type sniffing when OnDataAvailable is called.

So this patch targets this case and applying Opaque Response Blocking after the type is recognized by nsUnknownDecoder.

Attachment #9217002 - Attachment description: WIP: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail. → Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail.
Attachment #9217002 - Attachment description: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail. → WIP: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail.
Attachment #9213733 - Attachment description: Bug 1701868 - Opaque response blocking after UnknownDecoder recognizes the allowed or blocked type. r=necko-reviewers → Bug 1701868 - Opaque response blocking after UnknownDecoder recognizes the allowed or blocked type.
Attachment #9217002 - Attachment description: WIP: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail. → Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail.
Attachment #9217002 - Attachment description: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail. → WIP: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail.
Attachment #9217002 - Attachment description: WIP: Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail. → Bug 1701868 - Testcase for OpaqueResponseBlocking with type sniffing fail.
Pushed by echuang@mozilla.com:
https://hg.mozilla.org/integration/autoland/rev/3a282dee4cdc
Testcase for OpaqueResponseBlocking with type sniffing fail. r=necko-reviewers,dragana
https://hg.mozilla.org/integration/autoland/rev/27ab35eef920
Opaque response blocking after UnknownDecoder recognizes the allowed or blocked type. r=necko-reviewers,dragana
Status: ASSIGNED → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 90 Branch
Whiteboard: [necko-triaged] → [necko-triaged][sp3]
Whiteboard: [necko-triaged][sp3] → [necko-triaged]
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: