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

Add text/plain MIME type for YAML files #1043

Merged
merged 2 commits into from Mar 13, 2015
Merged

Conversation

new23d
Copy link
Contributor

@new23d new23d commented Dec 5, 2014

The currently specified MIME types "/yaml", "/x-yaml" are not generally found on any popular web server. See http://www.iana.org/assignments/media-types/media-types.xhtml . Consequentially, the MIME type returned for a YAML file hosted via a common web server is text/plain . This change shouldn't affect XML files served since they do have a globally accepted MIME type and will be served with that in the header.

Facing issues with being able to serve such a file off a shared service. Seeing...

ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 1.url (URL Source), project: XYZ] 
com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error requesting URL Resource Model Source: http://f.q.d.n/xyz.yaml: Response content type is not supported: text/plain

Caused by: com.dtolabs.rundeck.core.resources.format.UnsupportedFormatException: No provider available to parse MIME type: text/plain
        at com.dtolabs.rundeck.core.resources.format.ResourceFormatParserService.getParserForMIMEType(ResourceFormatParserService.java:193)
        at com.dtolabs.rundeck.core.resources.URLResourceModelSource.getNodes(URLResourceModelSource.java:309)

...in the logs.

The currently specified MIME types "*/yaml", "*/x-yaml" are not generally found on any popular web server. See http://www.iana.org/assignments/media-types/media-types.xhtml . Consequentially, the MIME type returned for a YAML file hosted via a common web server is text/plain . This change shouldn't affect XML files served since they do have a globally accepted MIME type and will be served with that in the header.

Facing issues with being able to serve such a file off a shared service. Seeing...

ERROR ExceptionCatchingResourceModelSource: [ResourceModelSource: 1.url (URL Source), project: XYZ] 
com.dtolabs.rundeck.core.resources.ResourceModelSourceException: Error requesting URL Resource Model Source: http://f.q.d.n/xyz.yaml: Response content type is not supported: text/plain

Caused by: com.dtolabs.rundeck.core.resources.format.UnsupportedFormatException: No provider available to parse MIME type: text/plain
        at com.dtolabs.rundeck.core.resources.format.ResourceFormatParserService.getParserForMIMEType(ResourceFormatParserService.java:193)
        at com.dtolabs.rundeck.core.resources.URLResourceModelSource.getNodes(URLResourceModelSource.java:309)

...in the logs.
@new23d new23d changed the title Correct MIME Type for YAML files Correct MIME type for YAML files Dec 5, 2014
@gschueler
Copy link
Member

thanks. The patterns used */x-yaml and */yaml were probably based on stackoverflow search results (e.g. http://stackoverflow.com/a/332159/666481 ) and being unsure what is out there "in the wild". Perhaps it's better to append text/plain to the supported mime types, instead of replacing the existing ones, to prevent breaking things for someone already relying on one of those mime types.

@gschueler gschueler added this to the 2.5.0 milestone Mar 11, 2015
@gschueler gschueler changed the title Correct MIME type for YAML files Add text/plain MIME type for YAML files Mar 13, 2015
gschueler added a commit that referenced this pull request Mar 13, 2015
Add text/plain MIME type for YAML files
@gschueler gschueler merged commit 3194eb5 into rundeck:development Mar 13, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants