Skip to content
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

8273655: content-types.properties files are missing some common types #5506

Closed
wants to merge 3 commits into from

Conversation

FrauBoes
Copy link
Member

@FrauBoes FrauBoes commented Sep 14, 2021

This change adds some common types to the content-type.properties files, notably .js, .css, and .jar, as well as some others.

The duplicated entry for .zip is removed from the Windows properties file.


Progress

  • Change must not contain extraneous whitespace
  • Commit message must refer to an issue
  • Change must be properly reviewed

Issue

  • JDK-8273655: content-types.properties files are missing some common types

Reviewers

Reviewing

Using git

Checkout this PR locally:
$ git fetch https://git.openjdk.java.net/jdk pull/5506/head:pull/5506
$ git checkout pull/5506

Update a local copy of the PR:
$ git checkout pull/5506
$ git pull https://git.openjdk.java.net/jdk pull/5506/head

Using Skara CLI tools

Checkout this PR locally:
$ git pr checkout 5506

View PR using the GUI difftool:
$ git pr show -t 5506

Using diff file

Download this PR as a diff file:
https://git.openjdk.java.net/jdk/pull/5506.diff

@bridgekeeper
Copy link

bridgekeeper bot commented Sep 14, 2021

👋 Welcome back jboes! A progress list of the required criteria for merging this PR into master will be added to the body of your pull request. There are additional pull request commands available for use with this pull request.

@openjdk
Copy link

openjdk bot commented Sep 14, 2021

@FrauBoes The following labels will be automatically applied to this pull request:

  • net
  • nio

When this pull request is ready to be reviewed, an "RFR" email will be sent to the corresponding mailing lists. If you would like to change these labels, use the /label pull request command.

@openjdk openjdk bot added nio nio-dev@openjdk.org net net-dev@openjdk.org labels Sep 14, 2021
@FrauBoes FrauBoes marked this pull request as ready for review September 15, 2021 08:53
@openjdk openjdk bot added the rfr Pull request is ready for review label Sep 15, 2021
@mlbridge
Copy link

mlbridge bot commented Sep 15, 2021

Webrevs

@mlbridge
Copy link

mlbridge bot commented Sep 15, 2021

Mailing list message from Bernd Eckenfels on net-dev:

In the Test List .xml is not mentioned, that looks like a major format.

However I am not sure if it maybe needs extra handling because of possible different mime types for application/xml and text/xml?

--
http://bernd.eckenfels.net
________________________________
Von: net-dev <net-dev-retn at openjdk.java.net> im Auftrag von Julia Boes <jboes at openjdk.java.net>
Gesendet: Wednesday, September 15, 2021 10:57:55 AM
An: net-dev at openjdk.java.net <net-dev at openjdk.java.net>; nio-dev at openjdk.java.net <nio-dev at openjdk.java.net>
Betreff: RFR: 8273655: content-types.properties files are missing some common types

This change adds some common types to the content-type.properties files, notably .js, .css, and .jar, as well as some others.

The duplicated entry for .zip is removed from the Windows properties file.

-------------

Commit messages:
- add basic test
- initial change

Changes: https://git.openjdk.java.net/jdk/pull/5506/files
Webrev: https://webrevs.openjdk.java.net/?repo=jdk&pr=5506&range=00
Issue: https://bugs.openjdk.java.net/browse/JDK-8273655
Stats: 171 lines in 3 files changed: 155 ins; 0 del; 16 mod
Patch: https://git.openjdk.java.net/jdk/pull/5506.diff
Fetch: git fetch https://git.openjdk.java.net/jdk pull/5506/head:pull/5506

PR: https://git.openjdk.java.net/jdk/pull/5506
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://mail.openjdk.java.net/pipermail/net-dev/attachments/20210915/c2f8c2eb/attachment.htm>

@FrauBoes
Copy link
Member Author

Mailing list message from Bernd Eckenfels on net-dev:

In the Test List .xml is not mentioned, that looks like a major format.

However I am not sure if it maybe needs extra handling because of possible different mime types for application/xml and text/xml?

.xml is already contained in the properties files as such:

application/xml: \
    description=XML document;\
    file_extensions=.xml

application/xml seems to be the default type as per RFC7303 [1], I think it should suffice in this context.

Only the new types are added to the test.

[1] https://datatracker.ietf.org/doc/html/rfc7303#section-4.1

@FrauBoes
Copy link
Member Author

@anthonyvdotbe Thanks for the comments, I incorporated them with one exception: I didn't add typescript (.ts) as it conflicts with MPEG transport stream on several platforms.

A note on the test: I refactored it slightly to account for platform-specific type detection, for example in the case of .js, which is mapped to application/javascript on linux-aarch64 rather than text/javascript. The reason for this deviation is that the test uses Files.probeContentType, which only falls back to the content-types.properties file if no file type detector is installed.

Testing: tier1-3 all clear.

@prrace
Copy link
Contributor

prrace commented Sep 16, 2021

I don't understand why these files are platform-specific.
And if each platform port does need one, where is the one for macOS ?

@FrauBoes
Copy link
Member Author

I don't understand why these files are platform-specific.
And if each platform port does need one, where is the one for macOS ?

I'm not an expert in the area, it's probably down to historic reasons? The Unix version would be for all Unix varieties, unless a more specific source file is provided (thanks to @Michael-Mc-Mahon).

@openjdk
Copy link

openjdk bot commented Sep 20, 2021

@FrauBoes This change now passes all automated pre-integration checks.

ℹ️ This project also has non-automated pre-integration requirements. Please see the file CONTRIBUTING.md for details.

After integration, the commit message for the final commit will be:

8273655: content-types.properties files are missing some common types

Reviewed-by: bpb, dfuchs

You can use pull request commands such as /summary, /contributor and /issue to adjust it as needed.

At the time when this comment was updated there had been 89 new commits pushed to the master branch:

  • 5c21c00: 8267163: Rename anonymous loader tests to hidden loader tests
  • b3b4b1c: 8273907: Cleanup redundant Math.max/min calls in DefaultHighlighter
  • a67f0f9: 8273505: runtime/cds/appcds/loaderConstraints/DynamicLoaderConstraintsTest.java#default-cl crashed with SIGSEGV in MetaspaceShared::link_shared_classes
  • 26e5e9a: 8273654: JFR: Remove unused SecuritySupport.setAccessible(Field)
  • 4b3a4ff: 8273940: vmTestbase/vm/mlvm/meth/stress/gc/callSequencesDuringGC/Test.java crashes in full gc during VM exit
  • dad5d27: 8272867: JFR: ManagementSupport.removeBefore() lost coverage
  • 48aff23: 8272515: JFR: Names should only be valid Java identifiers
  • 4d95a5d: 8273933: [TESTBUG] Test must run without preallocated exceptions
  • 9aa12da: 8273934: Remove unused perfcounters
  • 4da45c4: 8270609: [TESTBUG] java/awt/print/Dialog/DialogCopies.java does not show instruction
  • ... and 79 more: https://git.openjdk.java.net/jdk/compare/b0d04976bd334f840cb91e3f6dfa2ea680948a39...master

As there are no conflicts, your changes will automatically be rebased on top of these commits when integrating. If you prefer to avoid this automatic rebasing, please check the documentation for the /integrate command for further details.

➡️ To integrate this PR with the above commit message to the master branch, type /integrate in a new comment.

@openjdk openjdk bot added the ready Pull request is ready to be integrated label Sep 20, 2021
@FrauBoes
Copy link
Member Author

/integrate

@openjdk
Copy link

openjdk bot commented Sep 21, 2021

Going to push as commit 65ed0a7.
Since your change was applied there have been 100 commits pushed to the master branch:

  • c60bcd0: 8273928: Use named run ids when problem listing tests
  • 6642d2e: 8273783: Simplify Metaspace arena guard handling
  • f242cb5: 8273797: Stop impersonating "server" VM in all VM variants
  • 240fa6e: 8273927: Enable hsdis for riscv64
  • 9c91ff5: 8274031: Typo in StringBuilder.readObject
  • d16bf04: 8273613: JFR: RemoteRecordingStream::start() blocks close()
  • 7ce60c6: 8273651: JFR: onMetadata(), setStartTime(), setEndTime() lacks test coverage
  • 1bd11a7: 8273887: [macos] java/awt/color/ICC_ColorSpace/MTTransformReplacedProfile.java timed out
  • ee3576a: 8256735: JFR: 'jfr' tool displays incorrect timestamps
  • 5fde4b6: 8273909: vmTestbase/nsk/jdi/Event/request/request001 can still fail with "ERROR: new event is not ThreadStartEvent"
  • ... and 90 more: https://git.openjdk.java.net/jdk/compare/b0d04976bd334f840cb91e3f6dfa2ea680948a39...master

Your commit was automatically rebased without conflicts.

@openjdk openjdk bot closed this Sep 21, 2021
@openjdk openjdk bot added integrated Pull request has been integrated and removed ready Pull request is ready to be integrated rfr Pull request is ready for review labels Sep 21, 2021
@openjdk
Copy link

openjdk bot commented Sep 21, 2021

@FrauBoes Pushed as commit 65ed0a7.

💡 You may see a message that your pull request was closed with unmerged commits. This can be safely ignored.

@FrauBoes FrauBoes deleted the 8273655 branch September 23, 2021 10:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
integrated Pull request has been integrated net net-dev@openjdk.org nio nio-dev@openjdk.org
5 participants