Skip to content
This repository has been archived by the owner on Oct 13, 2020. It is now read-only.

Malformed User Agent #4

Open
lelmarir opened this issue Jan 26, 2016 · 5 comments
Open

Malformed User Agent #4

lelmarir opened this issue Jan 26, 2016 · 5 comments

Comments

@lelmarir
Copy link

in HttpUtils the used user-agent is not valid:

The User-Agent request-header field contains information about the user agent originating the request. This is for statistical purposes, the tracing of protocol violations, and automated recognition of user agents for the sake of tailoring responses to avoid particular user agent limitations. User agents SHOULD include this field with requests. The field can contain multiple product tokens (section 3.8) and comments identifying the agent and any subproducts which form a significant part of the user agent. By convention, the product tokens are listed in order of their significance for identifying the application.

User-Agent = "User-Agent" ":" 1*( product | comment )

Where product is defined as:

product = token ["/" product-version]
product-version = token
token = 1*

And comment as:

comment = "(" *( ctext | quoted-pair | comment ) ")"
ctext = <any TEXT excluding "(" and ")">

so it should be "ApacheChemistryDotCMIS" (without spaces)
ps. and maybe it could also specify the version and the OS ("ApacheChemistryDotCMIS/0.7 (Windows NT 6.1)"

@soneyworld
Copy link

Hi, thanks a lot!
You are right, the default user agent is not "valid" but you are able to set the user agent via session parameter "SessionParameter.UserAgent". We are creating our user agent via this helper method:
https://github.com/OpenDataSpace/CmisSync/blob/devel/CmisSync.Lib/Utils.cs#L371

I hope this helps you to modify the user agent like you would like to.

@nicolas-raoul
Copy link

Having a valid user agent by default would be nice though :-)

@soneyworld
Copy link

You are right! This should fix your problem:
4ff8b6c

@lelmarir
Copy link
Author

thank you,
but, IMO, you should not send the hostname
and the user agent should be something like "ApacheChemistryDotCMIS/0.7 (Windows NT 6.1; it-IT) DSS/1.2.3"
because the app (DSS) is using a library (ApacheChemistryDotCMIS)

ps. the default user-agent should simply be "ApacheChemistryDotCMIS/0.7 (Windows NT 6.1; it-IT)", then the app should be able to "append" to it rather than override it

@soneyworld
Copy link

Ok, we are using the user agent in this special form to recognize it on our server side. Feel free to create your own user agent string in your own way.
I would also be very happy about a pull request with a solution. I'll integrate it as fast as possible.

Thanks a lot!

@soneyworld soneyworld reopened this Jan 26, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants