Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
N
nshmp-ws-static
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
ghsc
National Seismic Hazard Model Project
nshmp-ws-static
Commits
c2d03a27
Commit
c2d03a27
authored
1 year ago
by
Clayton, Brandon Scott
Browse files
Options
Downloads
Patches
Plain Diff
add content type header for csv
parent
6a1e90e1
No related branches found
No related tags found
2 merge requests
!141
Production Release | nshmp-ws-static
,
!140
Fix Swagger CSV Response
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
src/lib/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java
+9
-1
9 additions, 1 deletion
...a/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java
with
9 additions
and
1 deletion
src/lib/src/main/java/gov/usgs/earthquake/nshmp/netcdf/www/NetcdfService.java
+
9
−
1
View file @
c2d03a27
...
@@ -22,6 +22,7 @@ import gov.usgs.earthquake.nshmp.www.ResponseBody;
...
@@ -22,6 +22,7 @@ import gov.usgs.earthquake.nshmp.www.ResponseBody;
import
io.micronaut.http.HttpRequest
;
import
io.micronaut.http.HttpRequest
;
import
io.micronaut.http.HttpResponse
;
import
io.micronaut.http.HttpResponse
;
import
io.micronaut.http.MediaType
;
/**
/**
* Abstract service handler for {@code NetcdfController}.
* Abstract service handler for {@code NetcdfController}.
...
@@ -89,7 +90,14 @@ public abstract class NetcdfService<S, T extends Query> {
...
@@ -89,7 +90,14 @@ public abstract class NetcdfService<S, T extends Query> {
var
service
=
getService
(
query
);
var
service
=
getService
(
query
);
var
response
=
processRequest
(
httpRequest
,
query
,
service
);
var
response
=
processRequest
(
httpRequest
,
query
,
service
);
LOGGER
.
fine
(
"Result:\n"
+
response
);
LOGGER
.
fine
(
"Result:\n"
+
response
);
return
HttpResponse
.
ok
(
response
);
var
httpResponse
=
HttpResponse
.
ok
(
response
);
if
(
query
.
format
==
ResponseFormat
.
CSV
)
{
httpResponse
.
header
(
"Content-Type"
,
MediaType
.
TEXT_CSV
.
toString
());
}
return
httpResponse
;
}
catch
(
Exception
e
)
{
}
catch
(
Exception
e
)
{
var
url
=
httpRequest
.
getUri
().
toString
();
var
url
=
httpRequest
.
getUri
().
toString
();
return
NetcdfWsUtils
.
handleError
(
e
,
getServiceName
(),
url
);
return
NetcdfWsUtils
.
handleError
(
e
,
getServiceName
(),
url
);
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment