-
Notifications
You must be signed in to change notification settings - Fork 161
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
Added digest auth #56
base: master
Are you sure you want to change the base?
Conversation
I've created a branch but is still unstable, have a look if you want |
@niqdev I will have a look! |
Sorry, I pressed the button accidentally |
@amadeu01 can you please resolve the conflicts? |
@@ -13,7 +13,7 @@ buildscript { | |||
|
|||
allprojects { | |||
group = 'com.github.niqdev' | |||
version = '1.3.2' | |||
version = '1.3.3' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please revert this, I will change it when release the lib
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Okay
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, It could be done by gradle task.
def getVersionCode = { ->
try {
def code = new ByteArrayOutputStream()
exec {
commandLine 'git', 'rev-list', 'HEAD', '--count'
standardOutput = code
}
return Integer.parseInt(code.toString().trim())
} catch (exception) {
return "1";
}
}
// Version name is Last Tag Name + No. of commits form last Tag + short git sha
def getVersionName = { ->
try {
def stdout = new ByteArrayOutputStream()
exec {
commandLine 'git', 'describe', '--tags', '--dirty'
standardOutput = stdout
}
return stdout.toString().trim()
} catch (exception) {
return "0.0.0.1";
}
}
// Use
android{
defaultConfig {
...
versionCode getVersionCode()
versionName getVersionName()
...
}
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nice, so to use it properly i need to tag it just before release the lib i.e. ./gradlew build bintrayUpload
. correct? can you add it in a different PR unless you think is going to be different in #59?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
hi @niqdev
I will do another PR, for that change.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right, this should be set automatically.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here you go #115
if (sendConnectionCloseHeader) { | ||
urlConnection.setRequestProperty("Connection", "close"); | ||
} | ||
|
||
if (urlConnection.getResponseCode() == HttpURLConnection.HTTP_UNAUTHORIZED && !TextUtils.isEmpty(username) && !TextUtils.isEmpty(password)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if is worth it, maybe extract it in a method and add comment for why is needed, otherwise is fine.
The important thing is that it must be retrocompatible
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, I will do it later. Thanks for your feedback
@niqdev sorry for my delay, I’ll update it as soon as I got some free time. Thanks ! |
Please rebase it to recent master |
I had a problem that the Camera URL use some digest authentication. So, I included a library for handle this kind of authentication, for more information about the dependency included here. It simply handles the digest authentication throughout HTTP when it is needed.