View Issue Details

IDProjectCategoryView StatusLast Update
0026365mantisbtapi restpublic2019-11-21 01:30
Reporterpolzin Assigned To 
PrioritynormalSeveritymajorReproducibilityhave not tried
Status newResolutionopen 
Product Version2.22.1 
Summary0026365: Fix a possible installation issue for the mantis rest api
Description

On trying out the rest api, all requests were answered with "401 API token required", although the Authorization token was transmitted.
Adding the line

SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0

in $MANTISROOT/api/rest/.htaccess, as suggested by https://www.cyotek.com/blog/restoring-missing-authorization-header-when-using-php, fixed the issue.

Additional Information
diff --git a/api/rest/.htaccess b/api/rest/.htaccess
index 6b27d11..7b3007e 100644
--- a/api/rest/.htaccess
+++ b/api/rest/.htaccess
@@ -1,4 +1,5 @@
 # Based on Slim Framework recommendation @ http://docs.slimframework.com/routing/rewrite/
+SetEnvIf Authorization .+ HTTP_AUTHORIZATION=$0
 RewriteEngine On
 RewriteCond %{REQUEST_FILENAME} !-f
 RewriteRule ^ index.php [QSA,L]
TagsNo tags attached.

Activities

jersonlabtic

jersonlabtic

2019-11-21 01:30

reporter   ~0063115

wew

Issue History

Date Modified Username Field Change
2019-11-18 09:45 polzin New Issue
2019-11-19 11:50 dregad Additional Information Updated View Revisions
2019-11-21 01:30 jersonlabtic Note Added: 0063115