Thanks to visit codestin.com
Credit goes to github.com

Skip to content
This repository was archived by the owner on Oct 23, 2020. It is now read-only.

Conversation

@m3brown
Copy link
Contributor

@m3brown m3brown commented Sep 28, 2015

Travis tests began failing due to 'json' and 'csv' filetypes not being supported. The issue was traced to the mime.types file in https://github.com/cndreisbach/ring.middleware.mime-extensions not being present in the classpath.

It appears that some lein environments load the mime.types from another qu dependency first:

user=> (clojure.java.io/resource "mime.types")
#<URL jar:file:/home/vagrant/.m2/repository/com/amazonaws/aws-java-sdk/1.3.18/aws-java-sdk-1.3.18.jar!/mime.types>

Rather than messing with how lein orders its dependencies, we can work around this by adding a mime.types to qu's own resources directory. The file in this PR is a copy of the file in the ring.middleware.mime-extentions repo.

@marcesher
Copy link
Contributor

Some more context: For the past few years, this has worked because ring.middleware.mime-extensions was ordered earlier than the aws-java-sdk in lein's classpath. As of 2.5, lein's classpath ordering appears to have changed, and aws-java-sdk is now ordered earlier. Because ring-middleware.mime-extensions by default looks for mime.types on the entire classpath, it's now picking up the mime.types file in the aws-java-sdk jar before the one in ring.middleware.mime-extensions' own jar.

Basically, we've just been getting lucky for a few years. By putting the file in qu's resources directory, we guarantee that it'll get picked up first because lein orders project resources before dependencies. Yes, we're relying on that behavior not changing, but that seems like a reasonable bet.

We can also talk to @cndreisbach about a suitable fix for ring.middleware.mime-extensions itself so that it does a targeted search for the mime.types file by default

@marcesher
Copy link
Contributor

selfie-3

marcesher added a commit that referenced this pull request Sep 28, 2015
Add mime.types to prevent potential classpath conflicts
@marcesher marcesher merged commit e64e4aa into cfpb:master Sep 28, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants