سؤال

I'm creating a simple little (rest)API and now I would like to secure a part of this API with htpasswd (using the oauth library is too much hassle for the simple thing I'm trying to make). Is it possible to only use the .htpasswd file for incoming POST-request and not for GET-requests?

Or is this insecure to begin with (eg. can post-requests be disguised as GET-request)?

Thanks!

هل كانت مفيدة؟

المحلول

After searching for a while I found the answer somewhere myself. I noticed somewhere that the require valid-user part in the .htaccess file was surrounded by <Limit GET></Limit> and tried changing that to POST. And it worked!

<Limit POST>
require valid-user
</Limit>
مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top