center-for-threat-informed-defense / tram

TRAM is an open-source platform designed to advance research into automating the mapping of cyber threat intelligence reports to MITRE ATT&CK®.
https://ctid.mitre-engenuity.org/our-work/tram/
Apache License 2.0
436 stars 93 forks source link

Fix JSON export for reports (#175) #180

Closed mehaase closed 2 years ago

mehaase commented 2 years ago

JSON exports were being rendered through an HTML template due to content negotiation in the browser (e.g. Accept:text/html). This commit forces the renderer to use JSON regardless of content negotiation and also cleans up the json and docx export code.

sonarcloud[bot] commented 2 years ago

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
0.0% 0.0% Duplication

codecov[bot] commented 2 years ago

Codecov Report

Merging #180 (d4e968e) into main (5e07e7d) will decrease coverage by 0.00%. The diff coverage is 100.00%.

@@            Coverage Diff             @@
##             main     #180      +/-   ##
==========================================
- Coverage   95.76%   95.75%   -0.01%     
==========================================
  Files           9       10       +1     
  Lines         874      872       -2     
==========================================
- Hits          837      835       -2     
  Misses         37       37              
Impacted Files Coverage Δ
src/tram/renderers.py 100.00% <100.00%> (ø)
src/tram/urls.py 100.00% <100.00%> (ø)
src/tram/views.py 95.03% <100.00%> (-0.45%) :arrow_down:

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update f74039e...d4e968e. Read the comment docs.