Coder Social home page Coder Social logo

Comments (13)

gary-rowe avatar gary-rowe commented on July 19, 2024

You're quite right it is the en-419 language code that is failing.

The problem lies in this code within Jersey v1.17.1 LanguageTag:

    private boolean isValid(String tag) {
        int alphaCount = 0;
        for (int i = 0; i < tag.length(); i++) {
            final char c = tag.charAt(i);
            if (c == '-') {
                if (alphaCount == 0)
                    return false;
                alphaCount = 0;
            } else if (('A' <= c && c <= 'Z') || ('a' <= c && c <= 'z')) {
                alphaCount++;
                if (alphaCount > 8)
                    return false;
            } else {
                return false;
            }
        }
        return (alphaCount != 0);
    }

The code does not validate es-419 and so initiates a 400 BAD_REQUEST. Since this is the latest version of Jersey there is nothing we can do until they fix the problem. A JIRA issues has been raised JERSEY-1882 so you may want to go there and vote for it so that it gets more attention.

Once the fix is in place we will upgrade Jersey to accommodate it.

Right now all you can do is remove the Spanish (Latin American) from your browser languages.

from multibit-website-legacy.

luke-jr avatar luke-jr commented on July 19, 2024

I'm hitting this too:

Bad Accept-Language header value: 'en-GB, en-us;q=0.8, en;q=0.6, en_US;q=0.4, *'

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

I'll re-open in case your scenario is related.

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

In your case it is the en_US which is causing problems. According the to Accept-Language sub-section of the HTTP specification the fields must follow this pattern:

language-range  = ( ( 1*8ALPHA *( "-" 1*8ALPHA ) ) | "*" )

The hyphen is required, the underscore is not permitted. I think you will need to edit your browser/client header settings.

from multibit-website-legacy.

luke-jr avatar luke-jr commented on July 19, 2024

Being strict is great for development, but production websites should never just error out...

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

Agreed. I'll talk it over with Jim to determine if we can get nginx to do some header cleanup.

from multibit-website-legacy.

brianmcdo avatar brianmcdo commented on July 19, 2024

Hitting the same wall on Chrome 27.0.1453.116 m

Bad Accept-Language header value: 'en-US,en;q=0.8,es-419;q=0.6,es;q=0.4'

Request:

GET / HTTP/1.1
Host: www.multibit.org
Connection: keep-alive
Cache-Control: max-age=0
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,/;q=0.8
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/27.0.1453.116 Safari/537.36
Accept-Encoding: gzip,deflate,sdch
Accept-Language: en-US,en;q=0.8,es-419;q=0.6,es;q=0.4

Response

HTTP/1.1 400 Bad Request
Date: Tue, 09 Jul 2013 11:21:12 GMT
Content-Type: text/plain; charset=UTF-8
Vary: Accept-Encoding
Content-Encoding: gzip
Connection: close
Transfer-Encoding: chunked

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

@seburo Your language problem is the es-419 issue that lies deep within Jersey

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

Have pushed a fix for this. Will close once Jim has verified it is OK.

from multibit-website-legacy.

jim618 avatar jim618 commented on July 19, 2024

I have pushed Gary's fix to multibit.org and verified https://multibit.org/index.html using "Accept-Language:"s of
es,es-419;q=0.8,en;q=0.6,en-US;q=0.4
en-GB, en-us;q=0.8, en;q=0.6, en_US;q=0.4, *
en-US,en;q=0.8,es-419;q=0.6,es;q=0.4

These all work OK

from multibit-website-legacy.

danielnaber avatar danielnaber commented on July 19, 2024

Actually I still get this with Firefox 25.0:

Bad Accept-Language header value: 'de,de-de;q=0.8,en;q=0.6,en-us;q=0.4,chrome://global/locale/intl.properties;q=0.2'

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

Sorry about the slow response - I'll take a look this week.

from multibit-website-legacy.

gary-rowe avatar gary-rowe commented on July 19, 2024

The presence of "chrome://global/locale/intl.properties" is mentioned as #654099 in the Firefox bug database. There are other references to it occurring with the "Quick Locale Switcher" plugin, it may be that using the alternative "Locale Switcher" may be a better choice.

I've modified the website code to filter this string out and replace it with "en" since that's the main site language at present.

from multibit-website-legacy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.