-
Notifications
You must be signed in to change notification settings - Fork 289
#1998 WARC writer: WARC-Protocol header to follow WARC field proposals #2034
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -669,10 +669,11 @@ public Response intercept(Interceptor.Chain chain) throws IOException { | |
| .getBytes(StandardCharsets.ISO_8859_1)); | ||
|
|
||
| final StringBuilder protocols = new StringBuilder(response.protocol().toString()); | ||
| String cipherSuite = null; | ||
| final Handshake handshake = connection.handshake(); | ||
| if (handshake != null) { | ||
| protocols.append(',').append(handshake.tlsVersion()); | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What does this write, |
||
| protocols.append(',').append(handshake.cipherSuite()); | ||
| cipherSuite = handshake.cipherSuite().toString(); | ||
| } | ||
|
|
||
| // returns a modified version of the response | ||
|
|
@@ -686,6 +687,7 @@ public Response intercept(Interceptor.Chain chain) throws IOException { | |
| .header(ProtocolResponse.RESPONSE_IP_KEY, ipAddress) | ||
| .header(ProtocolResponse.REQUEST_TIME_KEY, Long.toString(startFetchTime)) | ||
| .header(ProtocolResponse.PROTOCOL_VERSIONS_KEY, protocols.toString()) | ||
| .header(ProtocolResponse.CIPHER_SUITES_KEY, cipherSuite) | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. what happens if
Contributor
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. WARC writer checks for null anyway, because another protocol implementation could have been used which does not collect the necessary information. If it's not available, it does not add the But I can change the code, so that no header is added, if no Cipher suite was used (connection over http://).
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't |
||
| .build(); | ||
| } | ||
| } | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why plural? One handshake gives one suite and the WARC header is singular. Once this key ships in persisted metadata we can't rename it - is
_cipher_suite_better while we still can?