Bug 258389 - [Curl] Replace handling of reason-phrase in ResourceResponseCurl
Summary: [Curl] Replace handling of reason-phrase in ResourceResponseCurl
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-06-21 22:27 PDT by Kenji Shukuwa
Modified: 2023-06-23 01:28 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Kenji Shukuwa 2023-06-21 22:27:47 PDT
In ResourceResponseCurl, the reason-phrase of the HTTP status line is obtained
in the ResourceResponse::setStatusLine function, but in order to reduce the code
to be maintained, replace it with extractReasonPhraseFromHTTPStatusLine of HTTPParsers.

Additionally, the reason-phrase can contain ":". Therefore, there is a possibility
that the reason-phrase cannot be obtained with the current processing.
(for example: HTTP/1.1 999 ABC:DEF)

https://github.com/WebKit/WebKit/blob/e45a46fae1a59709b4d5dd5c043352129364d150/Source/WebCore/platform/network/curl/ResourceResponseCurl.cpp#L117-L129
---
    auto splitPosition = header.find(':');
    if (splitPosition != notFound) {
        ...
    } else if (startsWithLettersIgnoringASCIICase(header, "http"_s)) {
        // This is the first line of the response.
        setStatusLine(header);
    }
---
Comment 1 Kenji Shukuwa 2023-06-21 22:34:53 PDT
Pull request: https://github.com/WebKit/WebKit/pull/15180
Comment 2 EWS 2023-06-21 22:51:02 PDT
Committed 265395@main (007a3ea80d5c): <https://commits.webkit.org/265395@main>

Reviewed commits have been landed. Closing PR #15180 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-06-21 22:52:16 PDT
<rdar://problem/111142631>
Comment 4 Fujii Hironori 2023-06-22 13:04:56 PDT
Some tests regresses. Could you take a look?

Buildbot: builder WinCairo-64-bit-Release-Tests build 1327 (265396@main)
https://build.webkit.org/#/builders/728/builds/1327

Regressions: Unexpected text-only failures (9)
  http/tests/inspector/network/resource-redirect-request-headers.html [ Failure ]
  http/tests/xmlhttprequest/extra-parameters.html [ Failure ]
  http/tests/xmlhttprequest/response-special-characters.html [ Failure ]
  http/tests/xmlhttprequest/status-after-abort.html [ Failure ]
  http/tests/xmlhttprequest/web-apps/012.html [ Failure ]
  http/tests/xmlhttprequest/web-apps/013.html [ Failure ]
  http/tests/xmlhttprequest/xmlhttprequest-missing-file-exception.html [ Failure ]
  http/tests/xmlhttprequest/zero-length-response-sync.html [ Failure ]
  http/tests/xmlhttprequest/zero-length-response.html [ Failure ]
Comment 5 Kenji Shukuwa 2023-06-22 18:58:39 PDT
(In reply to Fujii Hironori from comment #4)
> Some tests regresses. Could you take a look?
> 

Sure.
Comment 6 Kenji Shukuwa 2023-06-23 01:28:37 PDT
https://bugs.webkit.org/show_bug.cgi?id=258442